I'm doing long-running experiments in an IPython notebook running on a server, where the typical work cycle is: launch experiment, go to lunch, come back, check progress, check Facebook, check email, check Facebook again, turn off computer, come back, check Facebook, check progress, ...
The problem is that when I close the browser window where the notebook is running, the print/logging outputs are no longer saved in the notebook.
For instance, in my simple experiment:
import time
start_time = time.time()
for i in xrange(5):
print '%s seconds have passed' % (time.time()-start_time)
time.sleep(2)
print 'Done!'
If I run, close the tab, and come back 10 seconds later, I just see whatever the output was when the notebook was last saved. What I expect to see is:
0.000111818313599 seconds have passed
2.00515794754 seconds have passed
4.01105999947 seconds have passed
6.0162498951 seconds have passed
8.01735782623 seconds have passed
Done!
Presumably this will be fixed at some point in the future, but in the mean time is there some easy hack to make it continue printing to notebook output after closing the browser? Bonus points if it works for inline images.