number of files in a directory python code example
Example 1: python count files directory
import os
len(os.listdir(directory))
Example 2: count a number of file in a folder python
import os
len([item for item in os.listdir(folderPath)])
import os
len(os.listdir(directory))
import os
len([item for item in os.listdir(folderPath)])