python中os.path常用模块

1. os.path.sep:路径分隔符 linux下就用这个了’/’
2. os.path.altsep: 根目录
3. os.path.curdir:当前目录
4. os.path.pardir:父目录
5. os.path.abspath(path):绝对路径
6. os.path.join(): 常用来链接路径
7. os.path.split(path): 把path分为目录和文件两个部分,以列表返回

下面给出测试样例:有些函数还是很方便的。python下os.path模块的常见用法

相关文章:

  • 2021-07-12
  • 2021-10-02
  • 2021-09-05
  • 2022-01-30
  • 2021-07-30
  • 2022-01-11
  • 2021-09-22
猜你喜欢
  • 2021-12-18
  • 2022-12-23
  • 2022-01-08
相关资源
相似解决方案