It is possible to count the number of all files in a directory by:
import ospath = '/mnt/BIGDATA/'num_files = len([f for f in os.listdir(path) if os.path.isfile(os.path.join(path, f))])
As mentioned in How do I read the number of files in a folder using Python?
but what I should do is to count the number of files with a special suffix in a directory using python? for example count all '???.pdf' files in a directory.