[IPython-user] printing lots of stuff to the screen

Walter Dörwald walter@livinglogic...
Sat May 26 08:27:06 CDT 2007


Stefan van der Walt wrote:
> On Sat, May 26, 2007 at 12:48:34PM +0200, Walter Dörwald wrote:
>> * Running the icap command a second time doesn't show any output to the 
>> terminal while running.
> 
> On my system it does, although it is somewhat messed up (see below).
> 
>>> If I do
>>>
>>> from ipipe import icap
>>> icap('for i in range(10): print i')
>>>
>>> the result differs from when it is preceded by
>>>
>>> from ipipe import *
>>> ils
>> In what way does it differ?
> 
> In [1]: from ipipe import icap
> 
> In [2]: icap('for i in range(10): print i')
> 0
> 1
> 2
> 3
> 4
> 5
> 6
> 7
> 8
> 9
> 
> In [1]: from ipipe import *
> 
> In [2]: ils
> Out[2]: 
> In [3]: icap('for i in range(10): print i')
> 0
>  1
>   2
>    3
>     4
>      5
>       6
>        7
>         8
>          9
>           Out[3]:

I see. This doesn't happen when I use idump as the default display, via:

In [1]: import ipipe
In [2]: ipipe.defaultdisplay = ipipe.idump

It doesn't happen either when I switch between ibrowse and idump, via:
In [1]: icap('for i in xrange(10): print i') | idump
In [2]: icap('for i in xrange(10): print i') | ibrowse
In [3]: icap('for i in xrange(10): print i') | idump

>>> Does ibrowser change the state of the terminal in any way?
>> Well, it uses curses, but the state of the terminal should be reverted 
>> to the previous state, as it uses curses.wrapper()
> 
> Maybe there is a bug in curses somewhere?  It shouldn't make a
> difference whether ibrowser has been run or not, should it?

Indeed it shouldn't.

BTW, on which system are you testing this?

Servus,
    Walter


More information about the IPython-user mailing list