添加当前python文件路径到环境变量
文章目录
import os,sys
curPath = os.path.abspath(os.path.dirname(__file__))
filePath = os.path.split(curPath)[0]
sys.path.append(filePath)
sys.path.extend([filePath + '\\' + i for i in os.listdir(filePath)])import os,sys
curPath = os.path.abspath(os.path.dirname(__file__))
filePath = os.path.split(curPath)[0]
sys.path.append(filePath)
sys.path.extend([filePath + '\\' + i for i in os.listdir(filePath)])
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论