From wxpython.wx import * class myapp (wxapp): Def oninit (self): frame = wxframe (null, -1, "hello from wxpython") # The first parameter should be Self, omitted. The second is the father Class name, there is no (null), the third is not clear, followed by the title. The following should also have parameters for specifying window sizes, initial locations. .Show (true) Self.SettopWindow (frame)
The last two lines of the Return True ## Oninit method may be the same for all applications. SettopWindow method tells WXWindows This framework is one of the application owners (only one in this example), and you return true to indicate success. When all item layers are turned off, the application ends. # 录 .app = myApp (0) app.mainloop ()