假如这样的目录结构:
/test_root
....test.py
..../test_sub
........test_sub.py
........__init__.py
在test_sub.py中,如何加载上层目录中的 test.py??
1. 直接,import test,这样会报错
2. 我的__init__.py文件为空,是否可以通过修改__init__.py文件,动态加载呢???
THX every answer!!
/test_root
....test.py
..../test_sub
........test_sub.py
........__init__.py
在test_sub.py中,如何加载上层目录中的 test.py??
1. 直接,import test,这样会报错
2. 我的__init__.py文件为空,是否可以通过修改__init__.py文件,动态加载呢???
THX every answer!!
