count number of files in a folder python code example
Example 1: python count files directory
import os
len(os.listdir(directory))
Example 2: How to count number of files in each directory
du -a | cut -d/ -f2 | sort | uniq -c | sort -nr
Example 3: count a number of file in a folder python
import os
len([item for item in os.listdir(folderPath)])