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

Walter Dörwald walter@livinglogic...
Tue May 29 05:44:36 CDT 2007


Stefan van der Walt wrote:
> Hi Walter
> 
> Just some more feedback.
> 
> On Sat, May 26, 2007 at 03:27:06PM +0200, Walter Dörwald wrote:
>> 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
> 
> This works fine on my system too.
> 
>> 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
> 
> If you add another 'ibrowse' line you'll see the broken behaviour
> again.  Looks like the broken behaviour only influences ibrowse, and
> only on a consecutive run.

This is indeed strange. When I replace the last line with a longer
output, i.e.

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
In [3]: icap('for i in xrange(10000): print i') | ibrowse

I get the  staircase output starting with 9739, i.e.

...
9736
9737
9738
9739
    9740
        9741
            9742
                9743
                    9744
                        9745
                            9746
...

However I've changed your code a bit (see the attached updated version
of the patch), and the result doesn't have that problem (but don't ask
me why).

Servus,
   Walter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: icap.diff
Type: text/x-diff
Size: 2896 bytes
Desc: not available
Url : http://lists.ipython.scipy.org/pipermail/ipython-user/attachments/20070529/63ad1aa5/attachment.bin 


More information about the IPython-user mailing list