易截截图软件、单文件、免安装、纯绿色、仅160KB

看看这段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 异常退出

最近用python写一个程序,总是异常退出,但是却没法用try..except来捕捉

由于没法发图片,所以把相关的信息打印出来
异常的信息大致如下:

python.exe遇到问题需要关闭。我们对此引起的不便表示抱歉 ......

Python 数字与字符串连接问题

定义下面这样一个函数,将excel表格中两个单元格的内容连成一个字符串,但是如果前一个单元格的内容是数字,比如是“1”,后一个单元格的事字符串,就会报错unsupported operand type(s) for +=: 'float' an ......

python解压缩的问题

python如何解压缩.Z的文件啊,在windows系统环境下
Q7Z 是一款基于 Qt4 的 7z 压缩工具
http://code.google.com/p/k7z/

开源的

http://sourceforge.net/projects/k7z/

LS的能具体说一说吗?
......

python的引用计数

我用了def CreateMyDialog(self):
        dlg = MyDialog(None, -1, ''.decode('utf8'), (300,300), (300,200), wx.DEFAULT_DIALOG_STYLE | wx.DIALOG_NO_PARENT )
&nbs ......

求助:python读取mp3的id3标签信息问题

我的mp3标签信息是通过Tag&Rename 软件来修改的
修改的信息如下
Album Title ISRC
77 66 99

---python读取mp3的id3的代码----

from mutagen.mp3 import MP3
import mutagen.id3
......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号