Skip to content

Instantly share code, notes, and snippets.

@h3xh4wk
Created June 17, 2013 13:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save h3xh4wk/5796993 to your computer and use it in GitHub Desktop.
Save h3xh4wk/5796993 to your computer and use it in GitHub Desktop.
Find the count of files in a directory ( only one level)
import os
filecount = 0
for d in os.listdir("."): # the current directory /
filecount += len(os.listdir("./"+d))
print filecount
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment