【发布时间】:2019-10-31 23:23:15
【问题描述】:
如何根据完整路径加载 Python 模块?请注意,该文件可以位于文件系统中的任何位置,因为它是一个配置选项。 我在 ubutnu 中使用 python 3.5,到目前为止我的代码是:
创建python模块test.py
import sys
sys.path.append("test/lib/")
from tes1 import Client1
from tes2 import Client2
import tes3
【问题讨论】:
-
只要附加的路径包含您要导入的模块, sys.path.append() 就可以工作。你的问题到底是什么?不工作吗?
标签: python python-3.x