[IPython-dev] headless IPython

Gael Varoquaux gael.varoquaux@normalesup....
Thu Apr 19 01:23:13 CDT 2007


On Thu, Apr 19, 2007 at 01:54:39AM +0200, Andrew Dalke wrote:
> I've got an idea I would like to work on but I'm having
> a hard time getting started.

> What I want is an interactive Python session through a web interface.
> I'm doing this for chemistry so my example is:

>    >>> mol = load_molecule("input_filename")
>    >>> repr(mol)
>    <Molecule object at 0x827f0>)
>    >>> mol

>        .======.
>       /        \
>      /          \
>      \\         //
>       \\       //
>        ``-----''

>         benzene


> That is, molecule objects are displayed using one of several
> ways to depict the structure (image, java applet, or plugin,
> depending on user configuration).

> This will build up into a larger system, with more data types.
> For example, ideally I would also like if 'p' were a matplotlib
> plot then typing 'p'

>     >>> p

> should inline the plot in the browser display.  Very much like
> Mathematica and similar projects.

I am not sure if you are looking for something like pyreport:

http://gael-varoquaux.info/computers/pyreport/

It is not interactive, though the last few days I have started reworking
its internals to make it useable as a backend for interactive programs.
It definitely answers the issue of embedding the MPL plots in a non
interactive way. I will add an option to make it print answers from the
script as rest strings, so it opens the way to images and co. And this
option will be accessible from the script itself (either as comments or
with special commands).

The code itself is in general of non optimal quality but this is due to
the fact that I wrote most of the program when I didn't know python very
well. I am (slowly, very slowly) reworking the internals to make them
cleaner and more suited for use in backends (maybe one day I'll work on a
plugin for ipython).

Gaël


More information about the IPython-dev mailing list