wxPython不产生GUI输出

时间:2016-07-22 05:08:41

标签: python wxpython

对于使用wxPython的GUI新手。从书籍中尝试这段代码,它会产生以下输出,但没有带有消息字符串的GUI。这是代码..

Here's the code

And Here's the output

1 个答案:

答案 0 :(得分:1)

Python区分大小写,您需要使用大写' O'在OnInit

import wx

class MyApp(wx.App):
    def OnInit(self):
        wx.MessageBox('Hello Brian', 'wxApp')
        return True

app = MyApp()
app.MainLoop()
相关问题