问题
I would like to cite between methods inside this subclass "ImDisp", whose father class is "mywindow". But I found in "Bs" method, the 'BsInf' cannot be cited. Why?
class ImDisp(mywindow):
def __init__(self):
super(ImDisp,self).__init__()
def BsFig(self):
print('BsFig')
def BsInf(self):
print('BsInf')
def Bs(self):
self.BsInf #This doesn't work, why?
print('Bs')
回答1:
You should call the method by adding parentheses to the function object:
self.BsInf()
来源:https://stackoverflow.com/questions/54364276/how-to-cite-between-methods-inside-a-subclass