wxPython Interpreter

Here's a message I just sent to wx-users in reply to something that
Robin had posted there in January. It occurs to me that the
wxpython-users might be a good place for it too...

  David

Robin Dunn wrote:

>
> The solution that I am imagining is that the wxPython interpreter will
> be the event driven program. The main frame of the program will be the
> interactive interpreter (it might not have to be displayed). One event
> that will be handled is someone typing code into that interpreter.
> Interpreted code can generate other frames. When they are actaully
> handling something, the interpreter won't work, but when they are
> idleing, the interpreter would be accesable.
>

Something like this perhaps?

    http://alldunn.com/temp/interpreter.jpg

[I'm new to this list and wxPython (and relatively new to python, for that
matter), so forgive me if I'm not observing the correct thread protocol
by bringing up a thread from several months ago -- the message of Robin's
that I'm quoting above is from 1 Jan 2001.]

I'm interested in using wxPython from the python interpreter -- that is,
I don't want to use an interpreter in a wxPython window, as I understand
Robin is suggesting above. I'd like to call wxPython from the interpreter
without having the interpreter disappear forever once I call Mainloop. From
the interpreter, I'd like to pop up windows that do the usual cool wxPython
things while still being able to control the world from the interpreter.

From what I've read, I gather that the design of wxWindows and the way

threads in python work may make this difficult (same with Tkinter, I assume,
although I do seem able to get what I want if I just don't call mainloop;
despite what the documentation says, the windows do appear and respond to
events before mainloop is called!).

There are two reasons why I don't want to use an interpreter in a wxPython
window. First, I like using python from emacs and am very happy with
the emacs interface to python. Second, I plan to do lots of things from
the interpreter, and wxPython is only one of them, so just from a design
point of view it doesn't seem desirable to have wxPython controlling the
interpreter instead of the other way around.

As someone else pointed out in an earlier post, this style of using the
interpreter to deal with the GUI world is shared by matlab (as well as
mathematica, S-plus, and others). My first experience with it was using
lisp from emacs on a DEC KL10 and later on a Symbolics lisp machine (zmacs
instead of emacs). A friend of mine still works this way using Allegro
Common Lisp running under Windows NT. I'd much rather use python than
lisp, of course (but don't tell him I said so).

Most of my work involves data analysis and visualization, and working this
way makes it easy to get interesting things done without much overhead --
in particular, without much GUI-design overhead!

So what I'd like to know is... is this possible? Did I misunderstand Robin's
suggestion, in that what I want is already available? If it isn't, can
anyone give me some pointers on how I might do it myself?

Thanks.