path = "E:\\收藏夹\\C41\\C41" for filewalks in os.walk(path): pass # 生成器的输出为返回的是一个三元组(root, dirs, files),root表示当前目录,dir为当前root目录下的文件夹,files为当前root目录下的文件 print(filewalks)
python实现目录下,所有文件得循环
原文:https://www.cnblogs.com/lxz123/p/14388928.html