Python 您如何知道两个对象何时可以通信?
如果self指的是GuiMaker,那么How come self.start将调用TextEditor的start,或者self指的是TextEditor?GuiMaker从TextEditor继承了什么?换句话说,框架是TextEditor的后代吗?这将导致调用TextEditor的start方法 除此之外,我不认为编写的代码有任何方法可以让GuiMaker.start调用TextEditor.start是否从TextEditor继承?换句话说,框架是TextEditor的后代吗?这将导致调用TextEditor的start方法Python 您如何知道两个对象何时可以通信?,python,class,object,Python,Class,Object,如果self指的是GuiMaker,那么How come self.start将调用TextEditor的start,或者self指的是TextEditor?GuiMaker从TextEditor继承了什么?换句话说,框架是TextEditor的后代吗?这将导致调用TextEditor的start方法 除此之外,我不认为编写的代码有任何方法可以让GuiMaker.start调用TextEditor.start是否从TextEditor继承?换句话说,框架是TextEditor的后代吗?这将导致调
除此之外,我不认为编写的代码有任何方法可以使用GuiMaker.start调用TextEditor.start您可以始终使用打印语句或pdb断点查看实际调用的内容。您可以始终使用打印语句或pdb断点查看实际调用的内容。
class GuiMaker(Frame):
#more code
def __init__(self, parent=None):
Frame.__init__(self, parent)
self.pack(expand=YES, fill=BOTH) # make frame stretchable
self.start() # for subclass: set menu/toolBar
self.makeMenuBar() # done here: build menu-bar
self.makeToolBar() # done here: build tool-bar
self.makeWidgets() # for subclass: add middle part
#more code
class TextEditor:
#more code
def start(self):
#more code