python 中添加临时路径

记录一下, python 添加临时路径

import sys

sys.path.append('the_path') #将'the_path'目录加入搜索路径.


sys.path.insert(int, 'the_path') #第一个参数int, 表示这个路径搜索的优先程度, 0123...

就我个人而言, 用 insert(0, 'the_path') 比较好用, append 有时不管用, 暂时也不深究了.

猜你喜欢

转载自blog.csdn.net/mifangdebaise/article/details/126350053