1. 遍历目录---不递归
import os
for root, dirs, files in os.walk(dir):
for name in files:
print(os.path.join(root, name))
for name in dirs:
print(os.path.join(root, name))
标签:dirs,文件,join,name,root,print,操作,os From: https://www.cnblogs.com/codeshr/p/17097856.html