Last active
September 21, 2018 23:16
-
-
Save zanerobinson/95ad9f632e5885aaaef2076df9b53104 to your computer and use it in GitHub Desktop.
[directory parse] #walk #recursive #files #os
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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