Skip to content

Instantly share code, notes, and snippets.

@kgleeson
Created January 23, 2012 23:18
Show Gist options
  • Save kgleeson/1666310 to your computer and use it in GitHub Desktop.
Save kgleeson/1666310 to your computer and use it in GitHub Desktop.
Finds all *.ext in path and appends to matches
import fnmatch
import os
matches = []
for root, dirnames, filenames in os.walk(path):
for filename in fnmatch.filter(filenames, '*.ext'):
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