wxPython问题;未定义全局名称NULL
我正在尝试激活wxPython的教程代码,
当我告诉它从wxPython.wx导入*时,它工作正常
但由于包裹有误,
我已经按照要求将导入更改为WX
并将所有的wxthing更改为wx.某物
但当我启动它时,它给了我一个错误,说
回溯(最近一次呼叫):
文件"C:/Python25/SD",第32行,位于
App=MyApp(0)
文件"C:\Python25\Lib\site-packages\wx-2.8-msw-unicode\wx\_core.py",第7913行,位于__init__中
Sel._BootstrapApp()
文件"C:\Python25\Lib\site-packages\wx-2.8-msw-unicode\wx\_core.py",第7487行,位于_BootstRapApp中
Return_core_.PyApp__BootstrapApp(*args,**kwargs)
OnInit中的文件"C:/Python25/SD",第27行
Frame=MyFrame(空,-1,"来自wxPython的Hello")
NameError:未定义全局名称'Null'
选择 | 换行 | 行号
- import wx
- ID_ABOUT = 101
- ID_EXIT = 102
- class MyFrame(wx.Frame):
- def __init__(self, parent, ID, title):
- wx.Frame.__init__(self, parent, ID, title,
- wx.DefaultPosition, wx.Size(200, 150))
- self.CreateStatusBar()
- self.SetStatusText("This is the statusbar")
- menu = wx.Menu()
- menu.Append(ID_ABOUT, "&About",
- "More information about this program")
- menu.AppendSeparator()
- menu.Append(ID_EXIT, "E&xit", "Terminate the program")
- menuBar = wx.MenuBar()
- menuBar.Append(menu, "&File");
- self.SetMenuBar(menuBar)
- class MyApp(wx.App):
- def OnInit(self):
- frame = MyFrame(NULL, -1, "Hello from wxPython")
- frame.Show(true)
- self.SetTopWindow(frame)
- return true
- app = MyApp(0)
- app.MainLoop()
我是不是做错了什么?