GUI interactive prompt with non-text output

Tim Churches tchur at optushome.com.au
Sat Jun 21 16:37:14 EDT 2003


From: python-list-admin at python.org [mailto:python-list-admin at python.org]
> On Behalf Of James Tauber
> 
> On Sat, 21 Jun 2003 20:37:33 +1000, "Tim Churches"
> <tchur at optushome.com.au> said:
> > James Tauber wrote:
> > > Is anyone aware of extensions to a GUI interactive prompt (such as
> > that
> > > in IDLE) where the statements executed might be able to produce a
> > > graphical output after the input prompt as well as text (as you
would
> > get
> > > if you did a "print").
> [...]
> 
> > Have a look at PyCrust - see
http://www.orbtech.com/www/PyManual.html
> > Or if want a higher level interface to wxPython, try PythonCard (see
> > http://pythoncard.sourceforge.net/) - see Figure 5 of the turtle
example
> > at http://pythoncard.sourceforge.net/samples/turtle.html - is that
what
> > you had in mind?
> 
> It would if the pentagon had actually been drawn on the shell canvas
> immediately below the input that produced it.
> 
> I'm thinking of something that would support the following (but with
> nicely drawn graphics rather than the ASCII art):
> 
> >>> draw_square(side=100)
> 
>     +-----+
>     |     |
>     |     |
>     +-----+
> 
> >>> integrate("3x", "x")
> 
>          2
>        3x
>        --- + C
>         2
> 
> >>> draw_bar_graph([3,5,2])
> 
>    |   #
>    |   #
>    | # #
>    | # # #
>    | # # #
>    +-------

I suspect that could be achieved by dynamically inserting alternating
text and graphics canvas widgets in a wxPython grid or table. However,
personally I can't see why having two windows is less functional, as
long as the correspondence between the command and the output is
indicated and synchronised somehow. However, I can see why you might
want to mix the two when creating a permanent record of the session (for
printing, archiving or distribution), along with other comments or
explanatory text. It was Knuth who introduced the term "literate
programming" I think but it seems to have really taken hold with
statisticians and mathematicians - there is a list of tools to
investigate here: http://shelob.ce.ttu.edu/daves/lpfaq/faq.html

Tim C








More information about the Python-list mailing list