Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd class call to write_output(). #54 #55
Conversation
ruebot
requested changes
Apr 24, 2019
Update the README with the correct version number for |
ruebot
approved these changes
Apr 24, 2019
This comment has been minimized.
This comment has been minimized.
I can't get this to work. Am now on the right version of
But
still leading to
This is out of the box on MacOS, running |
This comment has been minimized.
This comment has been minimized.
Did a bit more testing. If I set up the function locally i.e. def write_output2(self, stdout, results):
""" Writes results to file.
:param stdout: Filepath for file.
:param results: A list of results.
:return: None.
"""
try:
with open(stdout, "w") as output:
for value in results:
output.write(str(value))
except Exception as exp:
print("Error writing the file.") then running write_output2(filename, year_results) gives me this error:
Is it working on your end, @greebie ? |
This comment has been minimized.
This comment has been minimized.
I should note that it works with Binder.. so something a bit funky with running it locally here. I may also be missing something obvious. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Not sure why it should not work. I think the problem with write_output2 is that you do not need 'self' in a simple function that is not part of a class. Can you do a 'restart and run all' and try again? That always messes me up. But yeah I had the same result as Nick. |
greebie commentedApr 24, 2019
This change adds the class call (nb.) to write_output() and adds the new version of au-notebook to requirements.txt.
To test:
spin the notebook
remove comment from this line in cell 6.
# nb.write_output(filename, year_results)
Run the notebook.
(Again, if you already have the notebook running, you will need to restart and run all).