(folder, pattern, recursive)
Generate file names in dir that match pattern.

    Args:
        folder: Root directory to search.
        pattern: File pattern to match.
        recursive: True to include subdirectories.
Generate file names in dir that match pattern.
Generate file names in dir that match pattern .
def findfiles(folder, pattern, recursive):
    """Generate file names in dir that match pattern.

    Args:
        folder: Root directory to search.
        pattern: File pattern to match.
        recursive: True to include subdirectories.
    """
    for dirpath, _, filenames in os.walk(folder, onerror=walk_error):
        yield from (os.path.join(dirpath, name)
                    for name in filenames
                    if fnmatch.fnmatch(name, pattern))
        if not recursive:
            break
def findfiles ( folder , pattern , recursive ) : for dirpath , _ , filenames in os . walk ( folder , onerror = walk_error ) : yield from ( os . path . join ( dirpath , name ) for name in filenames if fnmatch . fnmatch ( name , pattern ) ) if not recursive : break