Issue
I would like to print into the terminal window that runs IPython Notebook and not into the cell output. Printing into cell output consumes more memory and slows down my system when I issue a substantial number of print
calls. In essence, I would like this behaviour by design.
I have tried the following:
- I tried a different permutations of
print
andsys.stdout.write
calls - I looked at the IPython Notebook documentation here, here and here without help
- I have tried using this as a workaround but it seems to be only working on Python 2.7
Solution
You have to redirect your output to the systems standard output device. This depends on your OS. On Mac that would be:
import sys
sys.stdout = open('/dev/stdout', 'w')
Type the above code in an IPython cell and evaluate it. Afterwards all output will show up in terminal.
Answered By - MaxPowers
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.