Created
June 21, 2012 11:22
-
-
Save toast38coza/2965200 to your computer and use it in GitHub Desktop.
Recursively find all files that end with a certain extension with subdirectories
This file contains 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
# hat-tip: Sven Marnach | |
# http://stackoverflow.com/questions/5817209/browse-files-and-subfolders-in-python | |
htmlfiles = [os.path.join(root, name) | |
for root, dirs, files in os.walk(path) | |
for name in files | |
if name.endswith((".html", ".htm"))] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment