如果两个模块相互导入会发生什么?
为了概括这个问题,Python中的循环导入怎么样?
我想让我的两个python文件相互导入一些方法.这似乎给了我导入错误.
例:
file_A.py:
from file_B import do_B_stuff
Run Code Online (Sandbox Code Playgroud)
file_B.py:
from file_A import do_A_stuff
Run Code Online (Sandbox Code Playgroud)
我试图这样做的原因是因为我想以直观的方式组织我的项目,而不是根据编译器的意义组织它.
有没有办法做到这一点?
谢谢!