📜  python 获取当前脚本文件的目录 - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:24.232000             🧑  作者: Mango

代码示例2
import os
os.path.abspath(__file__) # Directory of current python script
#Output will look something like: C:\Users\UserName\Desktop\py-script.py