ANNOUNCE - IPython, a new interactive shell for Python.

Fernando Pérez fperez528 at
Sun Dec 9 23:11:55 EST 2001

WHAT: I'd like to announce IPython, an enhanced interactive Python shell. 

WHERE: (no fancy page, just a
readme and the tarballs).

PLATFORM: Linux/Unix. It may work in other OSes, I just don't know and can't
test it. Let me know. I did try to make it as portable as possible.

VERSION: 0.2.0, first public release.

A CAVEAT: if you look inside the code, you'll see big parts are a mess. I
know. Before you flame me into oblivion for writing code put together with
duct-tape and chewing-gum wrappers, please keep in mind this is my first
Python program ever and my first object oriented code ever. And, the code 
grew out a 'let's see if this works' thing, more as a proof of concept than a 
planned project. What I hope to get is enough people interested so that 
later (it will be a while, personal constraints right now prevent me from 
working more on it) it can be impoved.

But *for the user* it works quite well, so I figured it would be a good idea
to put it out. Hopefully a few good OO people will kick in later and help with
the badly needed internal restructuring.

STABILITY: I'd say very usable beta (it is my everyday Python
environment). Expect crashes every now and then, send bug reports and they'll
get fixed (it auto-generates a full post-mortem which you can mail). No new
features though until the rewrite (code is too fragile). But I think the
current feature set is quite complete and useful for end users.

LICENSE: Mainly LGPL, except for a few files under MIT and Python licenses.

MAIN AUTHORS: Fernando Pérez (currently main contact, blame me for all the
bugs), Janko Hauser, Nathan Gray (real email addresses in the code, never on


Fernando Pérez

Part of the README follows for the curious:

IPython tries to:

  i - provide a flexible, useful and powerful environment for interactive work
  in Python programming. It tries to address what we see as shortcomings of
  the standard Python prompt, and adds many features to make interactive work
  much more efficient.

  ii - offer a flexible framework so that it can be used as the base
  environment for other projects and problems where Python can be the
  underlying language. Specifically scientific environments like Mathematica,
  IDL and Mathcad inspired its design, but similar ideas can be useful in many
  fields. Python is a fabulous language for implementing this kind of system
  (due to its dynamic and introspective features), and with suitable libraries
  entire systems could be built leveraging Python's power.

  iii - serve as an embeddable, ready to go interpreter for your own programs.

Features overview

- Dynamic object information: typing ?word or word? prints detailed
information about an object. One can access docstrings, function definition
prototypes, source code, source files and other details. Information is even
provided about methods not currently defined as variables (as long as they are
available to Python, such as {}.get?).

- Numbered input/output prompts with command history (persistent across
sessions) and full searching in this history (via readline).

- Input prompts are cached, so old input can be processed as a string, exec'ed
or printed (useful for pasting of multi-line code into an editor without
prompt continuation garbage). Input line <n> is always available as variable
_i<n>, and _i, _ii and _iii contain the last three inputs.

- Output is also cached. IPython is meant to be extensible as an environment
for all sorts of work using Python as the base language. In scientific work
for example, one often needs easy access to previously computed
results. Output result <n> is available as _o<n>, and _o, _oo and _ooo contain
the last three results.

- Session logging (you can then later use these logs as code in your

- Session restoring: logs can be replayed to restore a previous session to the
state where you left it (this feature is not perfect yet, but works reasonably

- 'Magic' commands. A set of commands prefixed with @ is available for
controlling IPython itself and provides directory control, namespace
information and others. Users can define their own magic functions.

- Shell access. Lines starting with ! are passed directly to the system shell.

- Shell aliases. You can define with a simple syntax magic commands which
access the shell (so you don't have to type ! every time). With these
features, most routine shell-type work can be accomplished from within IPython
without special syntax.

- Completion in the local namespace, by typing TAB at the prompt. This works
for keywords, methods, variables and files in the current directory (python
names have precedence over filenames).

- Verbose and colored exception traceback printouts. Easier to parse visually,
and in verbose mode they produce tons of useful debugging information
(basically a terminal version of the cgitb module).

- Auto-parentheses and auto-quotes. Callable objects can be executed without
             sin 3 gets converted to sin(3).

You can also force this with a '/' as the first character.

Using ',' as the first character forces auto-quoting of the rest of the line:
      ,my_function a b  becomes my_function("a","b")

- Extensible input syntax. You can define filters that pre-process user input
to simplify input in special situations. For example, a module is provided
that allows using PhysicalQuantity objects (from Scientific Python) to be
input as 
        In [1]: v = 3 m/s
instead of the normal (and clumsy for interactive use):
        In [2]: v = PhysicalQuantity(3,'m/s')

These extensions can be done by the user without needing to touch any IPython
internal code.

- Flexible configuration system. It uses a configuration file which allows
permanent setting of all command-line options, module loading, code and file
execution. The system allows recursive file inclusion, so one can have a base
file with defaults and layers which load other customizations for particular
projects. Which file is to be loaded can be specified at the command line with
a simple -profile option. This allows easy configuration with vastly more
flexibility (easily) than Python's PYTHONSTARTUP.

- Embeddable. You can call IPython as a python shell inside your own python
programs. This can be used both for debugging code or for providing
interactive abilities to your programs with knowledge about the local
namespaces (very useful in data analysis situations, for example).

More information about the Python-list mailing list