python处理系统路径的相关操作:

# -*- coding: utf-8 -*-
 
import os
 
# 属性
print '__file__: %s' % __file__ # 绝对路径(包含文件名) abspath = os.path.abspath(__file__) print('abspath: %s' % abspath)
# 路径(剔除文件名) dirname
= os.path.dirname(abspath) print('dirname: %s' % dirname)

 

相关文章:

  • 2022-02-25
  • 2022-03-02
  • 2022-01-10
  • 2021-06-10
  • 2022-12-23
  • 2021-09-18
  • 2022-12-23
猜你喜欢
  • 2021-09-19
  • 2021-06-03
  • 2021-06-03
  • 2022-12-23
  • 2022-03-02
  • 2021-12-10
  • 2022-12-23
相关资源
相似解决方案