Dunno if this is the right place to ask somethin’ but it’s drive me crazy…Why when I make an wxPython application and i cause any kind of exception it shows me a traceback dialog for a few seconds and then it is closed.How can I develop an application if i’m wrong and I don’t know where and what!?
I'm guessing that you're passing 1 to wxApp.__init__, which redirects
stdout and stderr to a class that will open a wx window and write the
text there. Or you're passing 0 to it and running a `.py' file in
MSWindows by double-clicking on it or something like that (in this
latter case, the process doesn't have a terminal already available to
write it, so it opens one of its own).
In either case, I further guess that you're getting an unhandled
exception as part if your initialisation, not in an event-handler,
which causes Python to abort (exit); of course, when the Python
process terminates, all of the windows go away. `fixing' this is well
outside the scope of any Python module (e.g.: wxPython).
My advice is: start python attached to a terminal that's not going to
disappear when the Python process does, don't redirect the output to
one that will. Or redirect stderr to a text-file, either with whatever
facility your OS provides, or with a Python class at the beginning of
your app-code.
···
On Thu, Apr 18, 2002 at 03:32:54PM +0300, Ovidiu wrote:
Dunno if this is the right place to ask somethin' but it's drive me
crazy..Why when I make an wxPython application and i cause any kind
of exception it shows me a traceback dialog for a few seconds and
then it is closed.
--
M: Does it work?
N: Yes.
M: Did you test it?
N: What do you mean?
I've run into this problem (it's a windows thing).
I use the SciTE text editor (based on the Scintilla syntax-highlighting
editor class) for my python development. Running your python app from
within SciTE creates a new process, hence it doesn't care what GUI you
are using. SciTE also captures all stdout/stderr stuff (like error
messages) in a separate panel so you can see all the error messagse as
they happen and look back over previous ones. See www.scintilla.org
The only thing SciTE lacks is it's own debugger. However, since python
error messages are fairly explicit (assuming you get to read them!),
I've never missed this.
Bryan
···
On Thu, 2002-04-18 at 13:32, Ovidiu wrote:
Dunno if this is the right place to ask somethin' but it's drive me crazy..Why when I make an wxPython application and i cause any kind of exception it shows me a traceback dialog for a few seconds and then it is closed.How can I develop an application if i'm wrong and I don't know where and what!?
Dunno if this is the right place to ask somethin’ but it’s drive me crazy…Why when I make an wxPython application and i cause any kind of exception it shows me a traceback dialog for a few seconds and then it is closed.How can I develop an application if i’m wrong and I don’t know where and what!?
pass 0 (zero) when you create your wxApp or
wxPySimpleApp. eg... app =
wxPySimpleApp(0)instead ofapp =
wxPySimpleApp() [ ...] The name of the param
that we're passing zero is 'redirect' (i think)
as in redirect STDOUT & STDERR to a popup
window... I always turn it off too...
Except that passing 0 results in even less
visibility (at least for me). I've had the best
luck when passing in a filename ( 'app =
MyApp("output.txt")' ), which then redirects
stdout and stderr to that file. Then I can
inspect that file at my leisure.
Jeff Shannon
Technician/Programmer
Credit International