import os
file_count = 0
for dispatch, dirnames, filenames in os.path.walk('待分析目录'):
for file in filenames:
file_count += 1
print file_count
import os
file_count = 0
for dispatch, dirnames, filenames in os.path.walk('待分析目录'):
for file in filenames:
file_count += 1
print file_count
本文标题:python统计文件夹和子文件夹下的文件个数
本文链接:https://www.haomeiwen.com/subject/dxxhoqtx.html
网友评论