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, c
Well, found an ok solution. Solution is in this file: https://github.com/QUVA-Lab/artemis/blob/master/artemis/fileman/persistent_print.py
With example use: https://github.com/QUVA-Lab/artemis/blob/master/artemis/fileman/test_persistent_print.py
The demo now looks like:
import time
from general.persistent_print import capture_print, reprint
capture_print()
start_time = time.time()
for i in xrange(5):
print '%s seconds have passed' % (time.time()-start_time)
time.sleep(2)
print 'Done!'
And if I run
reprint()
In the next cell, it will redisplay all the print statements made since capture_print
was called. Obviously it would be better if this were unnecessary, but it works for now.