打开终端,输入以下命令就ok了
sudo apt-get install python-wxgtk2.8 python-wxtools python-wxaddons
但发觉在
http://forum.ubuntu.org.cn/viewtopic.php?t=134514&view=next&sid=06d59cc8f28cc210c84c86183721bc38
那个连接说是这样的.
sudo apt-get install python-wxgtk2.8 python-wxtools python-wxaddons wx2.8-i18n
但我发觉我的这样安装没问题, 输入以下代码进行测试都没有问题:
import wx
class DemoApp(wx.App):
def OnInit(self):
frame = DemoFrame(parent=None, id=-1, title=’DeveloperWorks’)
frame.Show()
return True
class DemoFrame(wx.Frame):
def __init__(self, parent, id, title):
wx.Frame.__init__(self, parent, id, title)
sizer = wx.BoxSizer(wx.VERTICAL)
self.SetSizer(sizer)
button = wx.Button(self, wx.ID_CLOSE, “Click Me”)
sizer.Add((1, 110))
sizer.Add(button, 0, wx.ALL, 20)
self.Bind(wx.EVT_BUTTON, self.OnButtonClick)
def OnButtonClick(self, event):
self.Close(True)
if __name__ == “__main__”:
app = DemoApp()
app.MainLoop()
在我的windows, python2.4运行都没问题,顺便记录, 在windows安装wxpython是到
http://www.wxpython.org/download.php, 找win32那些版本下载,下载后执行安装文件就行了,这个比Linux的安装还简单。