Unable to run Simple Example
Alex Martelli
aleax at aleax.it
Wed Jan 30 11:10:13 EST 2002
"DJ Webre" <d_webre at yahoo.com> wrote in message
news:mailman.1012402068.30964.python-list at python.org...
...
> from wxPython.wx import *
This lime should be flush left, otherwise you'll get
a SyntaxError
> class MyApp(wxApp):
> def OnInit(self):
> frame = wxFrame(NULL, -1, "Hello World")
> frame.Show(true)
> self.SetTopWindow(frame)
> return true
>
> app = MyApp(0)
> app.MainLoop()
The last two lines should be flush left, again. As you
give them, they're running as part of the class
statement, *before* name MyApp is bound in the global
module dictionary. Flush left, they're outside of the
class statement and run AFTER it, thus after name MyApp
is bound -- so you get to generate your MyApp instance
and call its MainLoop method, and things should work.
Alex
More information about the Python-list
mailing list