MCPcopy Index your code
hub / github.com/dabeaz/python-cookbook / gen_find

Function gen_find

src/4/creating_data_processing_pipelines/example.py:7–13  ·  view source on GitHub ↗

Find all filenames in a directory tree that match a shell wildcard pattern

(filepat, top)

Source from the content-addressed store, hash-verified

5import re
6
7def gen_find(filepat, top):
8 '''
9 Find all filenames in a directory tree that match a shell wildcard pattern
10 '''
11 for path, dirlist, filelist in os.walk(top):
12 for name in fnmatch.filter(filelist, filepat):
13 yield os.path.join(path, name)
14
15def gen_opener(filenames):
16 '''

Callers 1

example.pyFile · 0.85

Calls 1

joinMethod · 0.80

Tested by

no test coverage detected