【发布时间】:2013-05-28 14:54:44
【问题描述】:
class A(object):
def routine(self):
print "A.routine()"
class B(A):
def routine(self):
print "B.routine()"
A().routine()
def fun():
b = B()
b.routine()
if __name__ == '__main__':fun()
当我使用上面的代码时,A().routine 执行 A 类方法中的命令,但是当我使用代码时:
import wx
class Example(wx.Frame):
def __init__(self, parent, title):
wx.Frame().__init__(parent, title=title, size=(300, 200))
self.Centre()
self.Show()
if __name__ == '__main__':
app = wx.App()
Example(None, title='Size')
app.MainLoop()
为什么会这样
wx.Frame().__init__(parent, title=title, size=(300, 200))
不像
那样工作A().routine()
而是显示错误: 类型错误:找不到所需的参数“父”{pos 1}
【问题讨论】:
标签: python-2.7 wxpython