My goal is to port a TKinter application which has a debugger, a shell and an
editor to wxPython ... it is a very dedicated application which, for one
thing, generates various objects prior to launching its shell; and passes
those objects to the shell.
wx.py is a shell that uses that wx.StyledTextCtrl to handle syntax
highlighting, etc. There are currently more than a few editors that use
the same wx.StyledTextCtrl as an editor, and which embed wx.py as a
shell. Some even include debuggers. I would suggest that you perhaps
look at some previously existing Python editors with shells and
debuggers to get an idea of how they do things.
More or less, they use the STC as an editor to define breakpoints, which
they pass on to a custom debug function via sys.settrace(). When
running, they capture information about the stack when a breakpoint is
found, and navigate to that line in the applicable editor.
The shell is usually a component used like any other wxPython control,
and as designed, runs in-process. That is, if you type something in that
causes an infinite loop or segfault, the editor that contains the shell
will be hung or crashed.
If you want to have a debugger and shell, I would suggest figuring out
how Idle's remote debugger/shell works, and attempt to reuse what they
have done. If you don't need any of the fancy stuff like autocomplete,
calltips, etc., you can check out PyPE's wx.py.shell subclass
(http://pype.sf.net/ download the source, and check in
plugins/interpreter.py and plugins/shell.py).
So I am now in the "reading-phase" process ... but cannot find documentation
on wx.py.shell (etc ...).
I was never able to find documentation for it. I have customized it in
my own application, so if you have any questions in particular, I can
try to answer them.
- Josiah
···
"Philippe C. Martin" <pmartin@snakecard.com> wrote: