I see there have been a number of replies to this already whle I was
offline, and that you've found a solution, but there are a couple things
that should be clarified.
The messages about leaked objects in the hybrid version (or with wxGTK built
with --enable-debug) go to the C runtime library's stderr stream.
The Python traceback messages go to sys.stderr, which initially is a wrapper
around the C runtime library's stderr stream, but which can be changed by
the program in various ways.
The Python version of the wxApp class can optionally reassign sys.stdout and
sys.stderr to write to a window or to a file. On MSW the deafult is to do
the reassignment and use the wxPyOnDemandOutputWindow class defined in
wx.py, on other systems the default is to leave it alone. (This is why many
of the samples have "app = MyApp(0)" to disable this on MSW since it may be
more confusing to a newbie than helpful.) The one spot where using the
output window doesn't quite work out well is if the exception happens before
or while the main frame of the app is being constructed in OnInit. There
have been some suggestions on how best to handle this that you can probably
find in the list archives, but constructing the app so it uses a file
instead works fine too.
There was a fairly recent contribution to wxPython.lib of a window that is
better than wxPyOnDemandOutputWindow in some ways. Look in
wxPython/lib/infoframe.py for details.
Normally I run things such that the sys.stderr is left alone and just
redirect stderr from the command line when needed. On MSW systems I use a r
eplacement shell called 4NT from http://www.jpsoft.com/, (they also have
4DOS for win9x systems.) The way to pipe both stdout and stderr to some
other process is like the following, (I don't know if it matches the default
command.com or cmd.exe or not):
python myapp.py &| more
I highly recommend 4NT or 4DOS to anybody stuck on a MSW system and doesn't
want the overhead of running cygwin. It gives you command-line recall and
editing, aliases, enhanced batch scripting capabilities, etc., etc., etc.
Unfortunately it's not free, but it's not a bad price, (and unlike most
software vendors they still charge the same for it now as they did 10 years
ago when I bought it the first time!)
···
"Robin Parmar" <escalation746@yahoo.com> wrote:
Using the Hybrid version of wxPython on win32 I get many lines of
memory statistics if something goes wrong with my program -- so many
that even a 50-line screen is not enough to actually see the error
that occured.
Capturing standard out, error out, or even defining my own try/else
block does nothing to change this.
How can I see the actual error that is happening?
--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!