how to get number of files through python in os code example Example: python count files directory import os len(os.listdir(directory))