Simple wxPython Application

Paul Moore gustav at morpheus.demon.co.uk
Sat Apr 19 09:39:44 EDT 2003


ekranawetter at bmw.co.at (ekranawetter_steyr) writes:

> from wxPython.wx import wxPySimpleApp, wxFrame
>   app = wxPySimpleApp()
>   frame = wxFrame(None, -1, "Hello World")
>   frame.Show(1)
>   app.MainLoop()
>
> I got a syntax error in line 2

If you typed it exactly like this, you'll get an error "SyntaxError:
invalid syntax", which admittedly is not very helpful. The problem is
the indentation. Indentation in Python is significant, and indicates
block structure. The first line (from...import) does not start a
block, so indenting the next line is wrong.

Sorry, I can't help with your second problem.

Paul.
-- 
This signature intentionally left blank




More information about the Python-list mailing list