How to count the number of files in a directory using Python
I need to count the number of files in a directory using Python. I guess the easiest way is len(glob.glob(‘*’)), but that also counts the directory itself as a file. Is there any way to count only the files in a directory? 28 Answers 28