python更改程序运行目录为程序所在文件夹

import os
import sys

os.chdir(sys.path[0])
在文件首加入上面这句话即可

原文地址:https://www.cnblogs.com/vinic-xxm/p/13602900.html