Mar-10-2017, 04:10 PM
Buran already posted first two functions. And last one could be:
import os def get_file_count(dir_path): count = 0 for name in os.listdir(dir_path): if os.path.isfile(os.path.join(dir_path, name)): count += 1 return countIts possible to do it like one-liner with comprehension, but that would be little confusing.