def locate(pattern, root=os.curdir):
    '''Locate all files matching supplied filename pattern in and below
    supplied root directory.'''
    for path, dirs, files in os.walk(os.path.abspath(root)):
        for filename in fnmatch.filter(files, pattern):
            yield os.path.join(path, filename)
Locate all files matching supplied filename pattern in and below
    supplied root directory.
recipes/Python/499305_Locating_files_throughout_directory/recipe-499305.py