摘要:
os.listdir(path)=>获取(path)下所有子文件和子文件夹
os.path.isdir(dir)=>判断(dir)是否为目录
os.rename(dir,newDir)=>重命名目录或文件名 阅读全文
摘要:
sorted(dirs,key = lambda i:int(re.match(r'(\d+)',i).group()))=>字符串中的数字按顺序排列 1,2,3,4...10,11...
os.path.join(path,dir)=>合并路径和文件名
chdir(newDir)=>改变当前工作目录到指定的路径
shutil.move(oldFilePath, newFilePath)=>移动文件到目标路径 阅读全文