Last active
December 6, 2019 18:39
-
-
Save dmwyatt/54b92611d6d11711a0aa to your computer and use it in GitHub Desktop.
[Recursive glob.] Demo of `fnmatch`. Matches filenames, recursively. From http://stackoverflow.com/questions/2186525/use-a-glob-to-find-files-recursively-in-python
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
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