[英]Python: Novice Class object prac and __main__
I've been trying to practice testing my modules by adding我一直在尝试通过添加来练习测试我的模块
if __name__ == '__main__':
That isn't a function, it's a method.那不是函数,而是方法。 You need to call the method off an object.您需要从对象中调用该方法。
p = Prac()
p.Fun()
what is the Question?问题是什么? i can't find the Question here我在这里找不到问题
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.