import os
for dirpath, dirnames, filenames in os.walk("C:\\Users\\Administrator\\Desktop\\test_video_image"):
file_count = 0
for file in filenames:
file_count = file_count + 1
print(dirpath,file_count)
# #打印结果:
""""
C:\Users\Administrator\Desktop\test_video_image 0
C:\Users\Administrator\Desktop\test_video_image\frame_test 0
C:\Users\Administrator\Desktop\test_video_image\frame_test\aaa 38
C:\Users\Administrator\Desktop\test_video_image\frame_test\bbbb 3
C:\Users\Administrator\Desktop\test_video_image\frame_test1 19
C:\Users\Administrator\Desktop\test_video_image\video_test1 26
""""