[IPython-user] Finishing data entry in IPython

Fernando Perez fperez.net@gmail....
Sat Jan 12 12:11:43 CST 2008


On Jan 12, 2008 10:14 AM, Ville M. Vainio <vivainio@gmail.com> wrote:
> On Jan 12, 2008 5:31 PM, Thorsten Kampe <thorsten@thorstenkampe.de> wrote:
>
> > when I enter constructs like this[1] I have to press three times Enter
> > before it's executed. Is that normal or configurable? I'd like to
> > press only two times Enter...
>
> It is normal, and there are no immediate plans to make it configurable.

But if you simply add or remove a single space to the next line,
ipython interprets that as 'done':

In [1]: if 3==3:
   ...:     print 55
   ...:  #### ->  Here I just added one extra space before I hit enter
55

We do this because otherwise, pasting code from scripts (which often
has whitespace) become very difficult.  In a line-oriented system this
is a tricky balancing act (look at the hideous code that does all of
it if you want).  If you have suggestions for improvements (with
patches), they're all welcome, but this is the best we've been able to
get so far.

Cheers,

f


More information about the IPython-user mailing list