embedding python in wxpython

Mike Driscoll kyosohma at gmail.com
Tue Dec 30 15:01:09 EST 2008


On Dec 30, 1:52 pm, 5lvqbw... at sneakemail.com wrote:
> Hi, I've looked around for a way to allow a python console from within
> a wxPython application, but have only found stuff on embedded/
> extending python with C/C++ or wxWidgets in C++, but not wxPython.
>
> Is this easy to do?  Can someone point me in the right direction?
>
> Also, typically when you embed a scripting language into a larger
> application, how do you get the console environment to share data with
> the larger application?
>
> For instance, if the application has some gui stuff (for example
> clicking on a object and dragging it around), how do you get
> "object.select(x,y)" to print out on the console, and vice-versa: the
> object gets selected if the user types "object.select(x,y)"?
>
> I'd like the console to be a bidirectional representation of what's
> going on in the gui, plus a general purpose evaluation environment
> where you can manipulate application data via some api which is
> automatically exposed to the console when the application opens up.
>
> I'm looking for high-level hints/strategies/directions.
>
> Thank you
> Michael

You should ask the guys on the wxPython list for pointers:
http://wxpython.org/maillist.php

I'm pretty sure I've seen it discussed there before. They already have
PyShell and PyCrumb that you could probably use within your program.
The wxPython includes demos of them and lots of other widgets.

Mike



More information about the Python-list mailing list