Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

GUI interactive prompt with non-text output

1 view
Skip to first unread message

James Tauber

unread,
Jun 21, 2003, 2:01:40 PM6/21/03
to

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").

I'm thinking along the lines of Mathematica, although another useful
mental picture might be a board game where you enter your move at a
prompt and then the board is drawn before giving you another prompt
(which the ability to scroll back to see the boards after each move).

Hopefully I'm describing what I'm after clearly enough.

What I would most like is some sort of library / widget / extension to
IDLE that is fairly generic, but another alternative would be open source
software that does something like this in the specific that I could then
make generic.

I thought I'd check if anyone knew of something like this before
embarking on writing my own.

NOTE: I'm not necessarily tied to it being Tk-based (although that is
what I know). If something exists in PyQt or wxWindows, I'm willing to
use this as an excuse to learn them :-)

James
--
James Tauber
http://jtauber.com/

James Tauber

unread,
Jun 21, 2003, 2:31:03 PM6/21/03
to

I guess another term would be "graphical command-line interface".
http://www.xmlterm.com/ is sort of an example of what I'm after.

James

On Sun, 22 Jun 2003 02:01:40 +0800, "James Tauber" <jta...@jtauber.com>
said:

> --
> http://mail.python.org/mailman/listinfo/python-list

Tim Churches

unread,
Jun 21, 2003, 6:37:33 AM6/21/03
to
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").
>
> I'm thinking along the lines of Mathematica, although another useful
> mental picture might be a board game where you enter your move at a
> prompt and then the board is drawn before giving you another prompt
> (which the ability to scroll back to see the boards after each move).

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?

Tim C


James Tauber

unread,
Jun 22, 2003, 12:36:21 AM6/22/03
to
On Sat, 21 Jun 2003 20:37:33 +1000, "Tim Churches"
<tc...@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])

| #
| #
| # #
| # # #
| # # #
+-------

>>>

and so on...

The best examples I've seen so far are
http://www.wolfram.com/products/mathematica/tour/page2.html
and
http://www.xmlterm.com

Tim Churches

unread,
Jun 21, 2003, 4:37:14 PM6/21/03
to
From: python-l...@python.org [mailto:python-l...@python.org]
> On Behalf Of James Tauber

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


James Tauber

unread,
Jun 22, 2003, 3:07:14 AM6/22/03
to
On Sun, 22 Jun 2003 06:37:14 +1000, "Tim Churches"
<tc...@optushome.com.au> said:
> 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.

Mathematica is a great example of a commercial app that takes this
approach.

I've started diving into the PyCrust/Py stuff from wxPython (thanks for
the pointer) and it looks like I should be able to do what I want by
modifying PyShell.

Thanks

James

James Tauber

unread,
Jun 22, 2003, 7:42:15 AM6/22/03
to
On Sun, 22 Jun 2003 15:07:14 +0800, "James Tauber" <jta...@jtauber.com>
said:

> I've started diving into the PyCrust/Py stuff from wxPython (thanks for
> the pointer) and it looks like I should be able to do what I want by
> modifying PyShell.

Actually, this assumes that wxStyledTextCtrl supports embedded non-text
widgets, which I'm not sure it does. Time for me to switch over to the
wxPython list, unless someone here knows if wxStyledTextCtrl can support
embedded non-text widgets.

0 new messages