Skip to content

Instantly share code, notes, and snippets.

@vsudilov
Created May 9, 2014 15:10
Show Gist options
  • Select an option

  • Save vsudilov/bc5ad3d64fa7187c4783 to your computer and use it in GitHub Desktop.

Select an option

Save vsudilov/bc5ad3d64fa7187c4783 to your computer and use it in GitHub Desktop.
Recursive find filename without glob (python)
#import fnmatch
#import os
matches = []
for root, dirnames, filenames in os.walk('/path/'):
for filename in fnmatch.filter(filenames, '*.py'):
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