[wxPython] wxQuestion

Hah - well(and hi Magnus)... I am also pretty new to wxpython(used to code
Tk, untill i found this much more interesting) - And I have only been
playing around with boa-contructor(which can do it, and therefore i
recommanded debuggin'), so I have never really looked into which can do it,
and which that cant. :stuck_out_tongue_winking_eye: But to run the program in a terminal should solve
the problem.

Regs,
Thomas

路路路

-----Original Message-----
From: Magnus Lycka [mailto:magnus@thinkware.se]
Sent: den 18 april 2002 16:16
To: wxpython-users@lists.wxwindows.org
Subject: RE: [wxPython] wxQuestion

At 14:45 2002-04-18 +0200, Thomas Jacobsen wrote:

What are you developing in ?! Which editor ? OS?
If your editor has a built-in debugger, you can run the program, and see
the errormessages there. :slight_smile:

This might not be so simple (hi Thomas). At least not
if the editor is a GUI program.

As you can see if you search through the archives of this
mailing list, it's not possible to run GUI programs from
within any IDE or GUI editor. Things simply collide when you
run different types of event loops inside each other. The GUI
program you are developing has to run in a separate process.
WingIDE does that, PythonWin doesn't, just to give two examples.

Ovidiu wrote:

Dunno if this is the right place to ask somethin' but it's drive me

crazy..

If you are still not completely crazy, this is
just the right place for you. :slight_smile:

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.

Your description of the problem is lacking some details.
I assume that you run Windows. I'm not sure whether you
are running from a command prompt or clicking in the GUI.

Either way, where error messages go is controlled by your
wxApp. I use something like this:

class MyApp(wxApp):
     ...

def main(logging='logfile.txt'):
     if len(logging) == 1 and logging in '01':
         app = MyApp(int(logging))
     else:
         app = MyApp(filename=logging)
     app.MainLoop()

if __name__=='__main__':
     import sys
     if len(sys.argv) >= 2:
         main(sys.argv[1])
     else:
         main()

I was about to say that you can figure the rest out from the docs, but
then I realized that the wxApp() takes no arguments according to the
docs?!? Anyway, calling wxApp() or wxApp(1) will place stdout/stderr
in a window which will be closed when your app crashes. (If this takes
a few seconds, I would suggest that you get a faster computer. :wink:
Initializing your app with wxApp(0) will place the output in the command
shell (which will also close with the app if you started it by double-
clicking in the GUI). The third version, wxApp(filename='myfile.txt')
will put the content of stdout/stderr in a file (myfile.txt in this
case). The version with a file might be your best shot if you have a
braindead command shell (Win98/command.com) where you can't scroll back.

As a little tip, I would suggest that you get used to using a command
shell/prompt, and try not to just click around in the GUI. In the long
run you will be much more productive using ten fingers rather than one...
cmd.exe in Win2k is not so bad, but command.com in the DOS derviates
(Win 98 etc) is brain dead. Get something else, for instance cygwin's bash.

The ErrorDialogs can also be of help. See the demo. I stopped using
it myself, since it seemed to cause some other problems here.

--
Magnus Lyck氓, Thinkware AB
脛lvans v盲g 99, SE-907 50 UME脜
tel: 070-582 80 65, fax: 070-612 80 65
http://www.thinkware.se/ mailto:magnus@thinkware.se

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwindows.org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users