Skip to content

Instantly share code, notes, and snippets.

@gregelin
Created October 9, 2010 11:18
Show Gist options
  • Save gregelin/618106 to your computer and use it in GitHub Desktop.
Save gregelin/618106 to your computer and use it in GitHub Desktop.
# http://www.daniweb.com/forums/thread126955.html
def processDirectory ( args, dirname, filenames ):
print 'Directory',dirname
for filename in filenames:
print ' File',filename
top_level_dir = "/usr/local"
os.path.walk(top_level_dir, processDirectory, None )
##os.path.walk() works with a callback: processDirectory() will be
##called for each directory encountered.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment