1.获取当前路径

os.getcwd()

2.获取当前文件父级路径

os.path.abspath(os.path.dirname(os.getcwd()))

3.获取当前文件的前两季路径

os.path.abspath(os.path.abspath(os.path.dirname(os.getcwd())))

 

相关文章:

  • 2022-12-23
  • 2021-06-22
  • 2021-11-23
  • 2021-12-20
  • 2021-12-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-10
  • 2022-12-23
  • 2021-12-10
  • 2021-11-23
相关资源
相似解决方案