修改后的程序还是不能运行,有错误。
Traceback (most recent call last):
File "test.py", line 32, in <module>
app = App()
File "/usr/lib64/python2.7/site-packages/wx-2.9.4-gtk2/wx/_core.py", line 8631, in __init__
self._BootstrapApp()
File "/usr/lib64/python2.7/site-packages/wx-2.9.4-gtk2/wx/_core.py", line 8196, in _BootstrapApp
return _core_.PyApp__BootstrapApp(*args, **kwargs)
File "test.py", line 6, in OnInit
self.frame = rFrame(parent=None, id=-1)
File "test.py", line 26, in __init__
self.Bind(wx.EVT_MENU, self.OnCloseMe, menu1)
File "/usr/lib64/python2.7/site-packages/wx-2.9.4-gtk2/wx/_core.py", line 4225, in Bind
assert source is None or hasattr(source, 'GetId')
AssertionError
应该是你 Bind 的用法有问题。