how to cite between methods inside a subclass

风流意气都作罢 提交于 2019-12-11 15:28:28

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!