调用类方法时报错:missing 1 required positional argument: 'self'

调用类方法时报错:missing 1 required positional argument: 'self'

 

这种情况是因为在调用方法时,没有提前定义这个类的实例,导致无法返回。只要先定义一个实例就可以了

 

posted @ 2020-07-20 19:56  hehehe_wy7  阅读(17319)  评论(0编辑  收藏  举报