看看这段Python代码问题出在哪
照着书上写的,执行时报错(Python2.6)
import wx
class InsertFrame(wx.Frame):
def __init__(self,parent,id):
wx.Frame.__init__(self,parent,id,'Frame With Button',size=(300,100))
panel = wx.Panel(self)
button = wx.Button(panel,label="Close",pos=(125,20),
size=(50,50))
self.Bind(wx.EVT_BUTTON,self.OnCloseMe,button)
self.Bind(wx.EVT_CLOSE,self.OnCloseWindow)
def OnCloseMe(self,event):
self.Close(True)
def OnCloseWindow(self,event):
self.Destroy()
if __name__=='__main__':
app = wx.PySimpleApp()
frame = InsertFrame(parent=None,id=-1)
frame.Show()
app.MainLoop()
报错信息如下:
Traceback (most recent call last):
File "D:\Python26\test\wx\button.py", line 19, in <module>
frame = InsertFrame(parent=None,id=-1)
File "D:\Python26\test\wx\button.py", line 4, in __init__
wx.Frame.__init__(self,parent,id,'
相关问答:
聊聊,我一直不是很理解为什么动态语言就不需要接口,我只是从建模的角度考虑,接口是一种合理的建模方式呀,特别是大的项目,而且代码容易维护。相比接口多重继承是一种很糟糕的方式。为什么动态语言就不需要接口, ......
我想用python写服务端,C#写客户端,另外想把客户端C#中的对象序列化后传给服务端,用python反序列化后重建对象,不知道有没有这个可能?如果有可能能否提供个思路?
一切皆有可能。
思路你已经说的挺清楚的了。 ......
我用了def CreateMyDialog(self):
dlg = MyDialog(None, -1, ''.decode('utf8'), (300,300), (300,200), wx.DEFAULT_DIALOG_STYLE | wx.DIALOG_NO_PARENT )
&nbs ......
a.xml内容如下:
</project>
<project name="asdf" branch="asfasdfas" naname="xiao xin" QD6="091010">
<compo ......
麻烦高手解答一下 谢谢了 我是新手 一些概念都不太清楚。。。
pyodbc is a Python module that allows you to use ODBC to connect to almost any database from Windows, Linux, OS/X, and more.
pyodbc是 ......