Also, is there and example of trapping the output from python within a running wxPython program? ie. When when an error is generated in
my wxPython program, where does the message go and how do I get it? This is something I really need to do. I'm running wxPython on
Windoze.
You can redirect sys.stdout and sys.stderr to any file-like object. From the manuals:
"
stdin
stdout
stderr
File objects corresponding to the interpreter's standard input, output and error streams. stdin is used for all interpreter input except for scripts but including calls
to input() and raw_input(). stdout is used for the output of print and expression statements and for the prompts of input() and raw_input(). The interpreter's own
prompts and (almost all of) its error messages go to stderr. stdout and stderr needn't be built-in file objects: any object is acceptable as long as it has a
write() method that takes a string argument. (Changing these objects doesn't affect the standard I/O streams of processes executed by os.popen(), os.system() or
the exec*() family of functions in the os module.)
"
I have successfully redirected stdout and stderr to a wxFrame and made it write all the output into a text box.
Josu.