Collecting Python's responses.

Fernando Perez fperez528 at yahoo.com
Wed Jun 23 01:04:33 EDT 2004


Jacek Generowicz wrote:

> I'm looking for ways of creating annotated records of Python
> interactive sessions, for documentation purposes. For example,
> something like
> 
>    # dir shows the contents of the namespace
>    >>> dir()
>    ['__builtins__', '__doc__', '__name__']
>    # Addition works too
>    >>> 1+2
>    3
> 
> However, I would like to automate the incorporation of Python's actual
> output, so I would like to run a program which looks something like
> this:

[snip]

This could be an easy addition to ipython (http://ipython.scipy.org).  It
already has all the display hooks in place, and in fact the output handler is
user-accessible.

Cheers,

f



More information about the Python-list mailing list