我有以下项目:
- root
-addons
-module1.py (contains the function func1)
-folder1
-module2.py (contains func2 which needs to use func1)
main.py (contains call to func2)
我正在尝试运行main.py
我是这样导入的:
from addons.module1 import func1
from folder1.module2 import func2
但是当我在main中调用func2
时,我会得到
未定义名称'func1'
如何通过导入魔术确保func2
知道func1
?
我正在使用python 3.7。