Looking for a good interactive shell

Fernando Perez fperez528 at yahoo.com
Mon Nov 22 19:37:36 EST 2004


Tomas wrote:

> Hi!
> 
> I'm looking for a replacement for the standard interactive python shell. So
> far I've tried IPython and PyCrust. I liked both, but I'm not 100% happy
> with any of them. My main complaint about IPython is its missing support for
> multiline editing. To do multiline editing, it has to start an external
> editor, but then I lose all the nice features like autocompletion.

The reason ipython lacks multiline editing, is because such a feature is beyond
what readline can provide.  The only way to get it is to write a full-blown
curses (or GUI) interface.  Because of my limited (time) resources, and the
portability problems of such an approach (curses doesn't work under Windows,
and is a finicky beast across platforms), I just had to omit this feature.

As Robert Kern mentioned, a (slooow) rewrite is under way (or rather, ramping
up) to enable ipython to be plugged into a GUI, with pycrust and IDLE being
likely initial targets.

In the meantime, besides Craig's vim suggestion, I can offer some more tips (I
know these are not full solutions, but they may help some):

1. You could try (X)Emacs.  There is full ipython support for emacs, and with
it you can do all your editing in Emacs and pass chunks of code to ipython for
execution.

2. Use the Ctrl-p feature of readline/ipython to recall quickly previous lines. 
I do some (limited to 4-6 lines) multiline editing in ipython this way, since
instead of hitting up-arrow umpteen times, you only need to type one or two
letters and Ctrl-p to recall the line you want.  It's not perfect, and I
wouldn't use it for extended editing, but it helps in some cases.

Cheers,

f




More information about the Python-list mailing list