Python 获取文件路径及文件目录

阅读 91

2022-08-23

import os

print (os.path.dirname(__file__))
print (os.path.abspath(__file__))
print (os.path.abspath(os.path.dirname(__file__)))
print (os.path.dirname(os.path.abspath(__file__)))

  



相关推荐

精彩评论(0)

0 0 举报