Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tee output to stdout #4

Open
et2010 opened this issue Aug 12, 2019 · 2 comments
Open

Tee output to stdout #4

et2010 opened this issue Aug 12, 2019 · 2 comments

Comments

@et2010
Copy link

et2010 commented Aug 12, 2019

Hi, @breathe Could you please support this?

jupyter/nbconvert#374

@breathe
Copy link
Owner

breathe commented Aug 12, 2019

Hmm @et2010 possibly -- I'm assuming the main use case for something like this would be to see the cell output as the notebook is executed and not to have to wait until after the notebook has fully executed? Or would it suffice for your needs to print something from the cells after the execution of the notebook has completed?

The first is a bit more complicated to support as I'm currently delegating to executenb method from jupyter to execute the notebook -- but I think I see a way to hack in something to execute code after each cell executes — which could potentially provide a way way to print the output incrementally during execution.

How would this feature ideally work for your needs? Would you want to see the json for the output cell's printed to stdout -- ... or maybe if the output cell type is "text/plain" then print the contents as text and otherwise print the json for the output cell ...?

@et2010
Copy link
Author

et2010 commented Aug 13, 2019

Thank you for your reply!

Sorry, I forgot to mention that I was using the following snippet from the example:

# output_notebook.ipynb will be a notebook file along with the rendered output cells
module = run_notebook_in_jupyter("./Example.ipynb", a_useful_mode_switch="non_idiot_mode")("some_useful_value", save_output_notebook="output_notebook.ipynb")

In this case, there is no output at all. I can only check the output in the saved notebook file. I was running some machine learning scripts/notebooks on the cloud and need to check the output to see if it went smoothly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants