Application Error with wxPython
Levente Sandor
sandorlevi at yahoo.com
Sun Dec 15 21:19:14 EST 2002
Try this:
from wxPython.wx import *
app = wxPySimpleApp() # We MUST create a wxApp instance before using any
# windows, even if we don't use it...
chooser = wxFileDialog(None)
if chooser.ShowModal() == wxID_OK:
choice = chooser.GetPath()
print choice
else:
print "Cancelled"
----
Levi
pennedinil at excite.com (DP) wrote in message news:<6af8e801.0212140241.62a05275 at posting.google.com>...
> This is (barely) related to a previous question I posted a few days
> ago.
>
>
> When I run -
>
> from wxPython.wx import *
> chooser = wxDirDialog(None)
> if chooser.ShowModal() == wxID_OK:
> choice = chooser.GetPath()
> print choice
> else:
> print "Cancelled"
>
> (Yes, that is the whole program. For now) I get the expected directory
> choice dialog and a printout of my choice on the console.
>
>
> When I run -
>
> from wxPython.wx import *
> chooser = wxFileDialog(None)
> if chooser.ShowModal() == wxID_OK:
> choice = chooser.GetPath()
> print choice
> else:
> print "Cancelled"
>
> I get an "python.exe - Application Error: Memory at _____ could not be
> read" etc. and the application closes.
>
>
> The same thing happens if I try any of the other controls in place of
> wxFileDialog, e.g., wxTextEntryDialog. I've tried number of different
> combinations, basically variations of the above, but always get the
> same result -- an application error.
>
> I'm hoping someone on this list can tell me if they're getting the
> same application error, or if I'm unique in this. If it's the former
> case, what should I be doing different? And if it's the latter, that
> this problem is unique to me, what can I do to fix it?
>
> I'm using WinXP Pro. And all of the demo that came with wxPython runs
> fine.
>
> Thanks in advance.
>
More information about the Python-list
mailing list