Python script to find extensions in directory

Here is a way to find out what type of windows extensions.  pictures in this case. Count how many of each.   import os ext_count = dict() my_root = r”C:\Users\jonallen\Pictures” # some dir to start in for root, dirs, files in os.walk(my_root): for file in files: pathname, exten = os.path.splitext(file) if exten in ext_count.keys(): ext_count[exten] += 1 else: ext_count[exten] = […]