[IPython-user] magic commands inhibit autoflush of output to console

Lev Givon lev@columbia....
Thu Apr 24 13:30:40 CDT 2008


It seems that the invocation of magic commands (e.g., ?,
%pcat, etc.) causes ipython to delay writing output
generated by any subsequently executed code to the console until the
entire block of code in question is run. For instance, if one runs the
following script

import time
for i in xrange(3):
    print i
    time.sleep(2)

from within ipython using %run myscript, accesses the help system with
the ? command, and then attempts to run the above script a second
time, one will notice that no output is written to the console until
the script finishes running. Is this behavior expected? I have
observed it using both ipython 0.8.2 and the latest development
revision on Linux with Python 2.5.2 (in both cases, I removed
~/.ipython prior to testing the behavior).

							L.G.


More information about the IPython-user mailing list