why "import wx" doesn't work?

monkey m at m.com
Thu Apr 28 17:30:55 EDT 2005


It is the current version of wxPython(2.6). But follow you instruction it
still can't work...
But if using the default "from wxPython.wx import *", it work, don't know
what is the problem. May be this is an old example that cannot work with
"import wx". Because I get another example and it is ok.

Anyway, I hope I can catch up with you guys here in python programming soon.
Thanks a lot ( :

> Assuming you've installed a version of wxPython that is recent enough
> that "import wx" works (it's really unclear from what you've written
> above), then the problem you are facing is not using the namespace that
> you've now imported.  Do this instead:
>
> class MyApp(wx.App):
>      def OnInit(self):
>          frame = wx.Frame(NULL, -1, "....
>
>
> Note that "wx." before everything from wxPython...
>
> -Peter





More information about the Python-list mailing list