I\'d like to have real-time access to both interpreter input and error and standard output. Preferably this information would be written to a file, so that I can poll the fi
See this Virtualenv article by Doug Hellmann, showing how to log an iPython session:
If you are comfortable working at the interactive prompt in this way, but want to record what you do for future reference after you close your session, you can use IPython’s logging feature to write the session to a file. To activate the log, use the control command
%logstart, as illustrated in Listing 5. The output file is a Python source file, so it is easy to clean it up and turn it into a “real” module when you are done experimenting.
In [6]: %logstart
Activating auto-logging. Current session state plus future input saved.
Filename : ipython_log.py
Mode : rotate
Output logging : False
Raw input log : False
Timestamping : False
State : active
In [7]: a = 5
In [8]: b = 6
In [9]: c = a * b
In [10]: c
Out[10]: 30
In [11]: d = [ a, b, c]
In [12]: d
Out[12]: [5, 6, 30]
In [13]: %logstop