Python crashes - cannot pin it down!

Brian Kelley bkelley at wi.mit.edu
Tue Apr 13 17:29:09 EDT 2004


> from wxPython.wx import *
> app = wxPySimpleApp()
> app.MainLoop()
> wxMessageBox("Hello")

Actually, you don't need the app.MainLoop() here.  Dialog boxes 
essentially start their own main loops.  The reason your application was 
crashing was because wxPython needs to have an application created 
before you can create windows and such, you can think of this as an 
initialization step.  It's not quite smart enough to know that an 
application hasn't been created though, hence the crash.

Brian



More information about the Python-list mailing list