[IPython-User] Stdout not immediately appearing using %run in IPython 0.10.1

Wes McKinney wesmckinn@gmail....
Sun Oct 17 13:13:34 CDT 2010


On Sun, Oct 17, 2010 at 12:50 AM, Wes McKinney <wesmckinn@gmail.com> wrote:
> I've been having this problem both in IPython 0.10 and 0.10.1 using
> EPD 6.2 on AMD64, Ubuntu 10.04.
>
> Here's  an example script:
>
> import time
>
> def f():
>    print 'a'
>    time.sleep(1)
>    print 'b'
>    time.sleep(1)
>    print 'c'
>    time.sleep(1)
>    print 'd'
>    time.sleep(1)
>    print 'e'
>
> if __name__ == '__main__':
>    f()
>
> In [1]: run foo2.py <-- OUTPUT APPEARS IMMEDIATELY
> a
> b
> c
> d
> e
>
> In [2]: import numpy
>
> In [3]: numpy.array? <-- press q right afterward
>
> In [4]: run foo2.py <-- NOTHING APPEARS UNTIL %run has completed
> a
> b
> c
> d
> e
>
> I've only noticed this problem on Linux, any clues?
>
> Thanks,
> Wes
>

I confirmed this problem on the stock Python 2.6.5 bundled with Ubuntu
10.04. Same issue if you call the built-in execfile instead of %run--
and sys.stdout is the only thing affected (if i change print to
sys.stderr.write(...) then that's fine).


More information about the IPython-User mailing list