wxpython 窗体程序的Hello world
import wx class MainFrame(wx.Frame): def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, id, title) class App(wx.App): def __init__(self): super(self.__class__, self).__init__() # wx.App.__init__(self) def OnInit(self): self.version = u"v1.0" self.title = "我的第一个窗体程序" + self.version frame = MainFrame(None, -1, self.title) frame.Show(True) return True if __name__ == "__main__": app = App() app.MainLoop()