【发布时间】:2019-04-21 13:45:00
【问题描述】:
我是 python 新手,我想将我的 add.py 脚本的结果打印到我的 main.py 脚本,但我得到一个错误 "第 2 行,在 print(add())TypeError: 'module' object is not callable"
main.py
import add
print(add())
添加.py
class sample:
def addition(self):
add = 1+1
return add
【问题讨论】: