标签: python import module
我有一个这样组织的Python项目:
在我的文件夹src中,我有一个名为Gallery的类
如何在我的文件夹“ test”中的脚本中导入此类Gallery?
感谢您的帮助
答案 0 :(得分:2)
您可以向运行时添加路径,以使其可用于整个脚本运行:
import sys sys.path.append('/path/of/other/imports') import stuff_from_folder