Skip to content

Instantly share code, notes, and snippets.

@lost-theory
Forked from anonymous/read_my_code_21.pyw
Created June 12, 2010 16:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lost-theory/435857 to your computer and use it in GitHub Desktop.
Save lost-theory/435857 to your computer and use it in GitHub Desktop.
import os
from fnmatch import fnmatch
def find(pat, root):
for path, dirs, files in os.walk(root):
for f in files:
if fnmatch(f, pat):
yield os.path.join(path, f)
if __name__ == "__main__":
for f in find("*.html", "."):
print f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment