Created
May 3, 2012 10:28
-
-
Save geoffalday/2584913 to your computer and use it in GitHub Desktop.
Get files from directory
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
#via http://stackoverflow.com/questions/2186525/use-a-glob-to-find-files-recursively-in-python | |
import fnmatch | |
import os | |
matches = [] | |
for root, dirnames, filenames in os.walk('src'): | |
for filename in fnmatch.filter(filenames, '*.c'): | |
matches.append(os.path.join(root, filename)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment