[IPython-user] capture run output to a file
Mon Mar 26 15:42:43 CDT 2007
Is there a easyish, somewhat elegantish way to capture the output of a
"run somefile.py" command to a file or file handle?
I did this, but it wasd brutal and not what I wanted
fh = file('test.out', 'w')
saveout = sys.stdout
sys.stdout = fh
sys.stdout = saveout
since the ascii control characters ended up in the output file and it
just didn't feel right...
More information about the IPython-user