import sys,os
BASE_DIR=os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))));
sys.path.append(BASE_DIR)
print(BASE_DIR) #D:\pycode
python 获取运行文件的路径
猜你喜欢
转载自blog.csdn.net/ljwy1234/article/details/83418910
今日推荐
周排行