使用wxPython并使用py2app构建它,我试图构建一个基本的gui应用程序。当我打开它的时候,码头只是结结巴巴的,好像它要打开什么东西,然后它就没有了。知道为什么吗?在
我运行的是OSX10.10.2、Python2.7.9和WXPython3.0.2.0OSXCocoa(经典)import wx
class MainFrame(wx.Frame):
def __init__(self, parent, title):
wx.Frame.__init__(self, parent, title=title, size=(400,200))
#Creating the menu
filemenu = wx.Menu()
filemenu.append(wx.ID_ABOUT, "&About", " This is the about panel.")
filemenu.AppendSeparator()
filemenu.Append(wx.ID_EXIT, "E&xit", " Terminate the program")
#Adding the menu bar
menuBar = wx.MenuBar()
menuBar.Append(filemenu, "&File")
self.SetMenuBar(menuBar)
self.Show(True)
app = wx.App(False)
frame = MainFrame(None, "Hello World")
app.MainLoop()
以及设置.py文件看起来像
^{pr2}$