适用情况:在test.py模块中需要导入其他文件下的模块model.py
方法:
在test.py模块中添加以下脚本:
import syssys.path.append("model.py的文件路径")import model导入模块关键是能够根据sys.path环境变量的值,找到具体模块的路径。
python--导入其他文件夹下的模块(.py文件)
原文:http://www.cnblogs.com/cygalaxy/p/6880244.html