[IPython-dev] Multi-line history entries

Fernando Perez fperez.net at gmail.com
Thu Jul 27 00:51:45 CDT 2006


On 7/26/06, Ville Vainio <vivainio at gmail.com> wrote:
> On 7/26/06, Walter Dörwald <walter at livinglogic.de> wrote:
>
> > Now that this is checked in I tried it out. This is what happens:
> >
> > In [1]: for i in xrange(4):
> >    ...:     print i
> >    ...:
> >    ...:
> > 0
> > 1
> > 2
> > 3
> > In [2]: for i in xrange(4):^J    print i
>
> Perhaps this is a problem with your readline version; it worked ok
> (i.e. linefeeds were linefeeds) on my home machine (ubuntu dapper).
> Anyone else bother giving it a try?

This part looks fine here (but I'm also running dapper, so it's not a
big surprise):


In [1]: for i in range(4):
   ...:     print i,
   ...:
   ...:
0 1 2 3

In [2]: for i in range(4):
    print i,
   ...:     print i+1,
   ...:
   ...:
0 1 1 2 2 3 3 4

In [3]: for i in range(4):
    print i,
    print i+2,
   ...:
   ...:
0 2 1 3 2 4 3 5


Nice enhancement, BTW.  Thanks, Jorgen!

> Does stuff w/o autoindenting (e.g. \ line continuation) work ok?

In [4]: for i in \
   ...: range(4):
   ...:     print i,
   ...:
0 1 2 3


That looks fine to me too.  I'll report any problems I see, but so far
it looks like a net gain, and probably the best that can be done in a
non-curses environment.  But it actually is quite functional, and is a
lot more useful than I'd initially thought.

f


More information about the IPython-dev mailing list