All pastes #2080745 Raw Edit

Unnamed

public python v1 · immutable
#2080745 ·published 2011-09-11 08:30 UTC
rendered paste body
def locate(pattern, root=os.curdir, filesonly=True):    for path, dirs, files in os.walk(os.path.abspath(root)):        for filename in fnmatch.filter(files, pattern):            yield os.path.join(path, filename)        if not filesonly:            for dd in dirs:                yield os.path.join(path,dd)