dieyaxianju

本机windows,文件目录F:\python\ClStudyDemo\osTest.py

 

os.path.realpath(_file_)——返回真实路径

os.path.split()——返回路径的目录和文件名

os.getcwd()——得到当前工作的目录

__file__ 是用来获得模块所在的路径的 

print(os.path.realpath(__file__))
print(os.path.split(os.path.realpath(__file__)))
print(os.getcwd())

 

分类:

技术点:

相关文章:

  • 2021-12-20
  • 2021-11-23
  • 2021-10-16
  • 2021-11-23
  • 2021-11-23
  • 2021-11-23
  • 2021-11-23
  • 2021-11-30
猜你喜欢
  • 2021-11-23
  • 2021-11-23
  • 2021-11-23
  • 2021-11-23
  • 2021-11-23
  • 2021-11-23
  • 2021-11-23
相关资源
相似解决方案