Skip to content

Instantly share code, notes, and snippets.

@zanerobinson
Last active September 21, 2018 23:16
Show Gist options
  • Save zanerobinson/95ad9f632e5885aaaef2076df9b53104 to your computer and use it in GitHub Desktop.
Save zanerobinson/95ad9f632e5885aaaef2076df9b53104 to your computer and use it in GitHub Desktop.
[directory parse] #walk #recursive #files #os
# Import the os module, for the os.walk function
import os
# Set the directory you want to start from
rootDir = '.'
for dirName, subdirList, fileList in os.walk(rootDir):
print('Found directory: %s' % dirName)
for fname in fileList:
print('\t%s' % fname)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment