python sys.path.append

mac2022-06-30  26

对于模块和自己写的程序不在同一个目录下,可以把模块的路径通过sys.path.append(路径)添加到程序中。

import os ,sys sys.path.append(os.path.join(os.path.dirname(__file__),'bin')

 

转载于:https://www.cnblogs.com/ezway/p/6553346.html

相关资源:JAVA上百实例源码以及开源项目
最新回复(0)