import os path, dirs, files = next(os.walk("./d1")) print(len(files))
Python3 统计文件夹下文件数量
原文:https://www.cnblogs.com/CharmCode/p/13962094.html