python os 文件操作

import os ''' 1. os.getcwd() 不需要传参,返回的是运行脚本所在的目录 2. os.listdir(path):列举目录下所有的文件。返回的是列表类型 ''' d=os.getcwd() l=os.listdir(os.getcwd()) print(d) print(l) ''' 2.os.path.abspath(path) 返回path的绝对路径 ''' d=
相关文章
相关标签/搜索