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
On Sun, 22 Jun 2003 02:01:40 +0800, "James Tauber" <jta...@jtauber.com>
said:
> --
> http://mail.python.org/mailman/listinfo/python-list
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
> 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
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
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
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.