[Tutor] imbedding python into another program?

André Roberge andre.roberge at gmail.com
Thu Jun 2 00:26:59 CEST 2005


Jeff Peery wrote:
>     hello, is it possible to add something like the python IDLE into
>     another program, say if I wanted to simply run scripts from within a
>     wxPython program? Could someone point me to the correct reference?
>     thanks.
> 
Hi Jeff,

you may want to have a look at PyCrust, PyShell and the like.
I do something like this in my rur-ple app (on sourceforge).

The relevant lines of code are:

import wx.py as py

[inside a wx.Notebook]
win = py.shell.Shell(self.window, -1,
                      introText = tr.INTERPRETER_INTRO_TEXT)
self.window.AddPage(win, tr.PYTHON_INTERPRETER)
============

HTH,

André



More information about the Tutor mailing list