(location, collect)
return collect
Returns a list of all files in a directory.
Returns a list of all files in a directory.
Returns a list of all files in a directory .
def findfiles(location, collect):
    """
    Returns a list of all files in a directory.
    """

    for item in os.scandir(location):

        if item.is_dir():
            findfiles(item.path, collect=collect)
        else:
            collect.append(os.path.abspath(item.path))

    return collect
def findfiles ( location , collect ) : for item in os . scandir ( location ) : if item . is_dir ( ) : findfiles ( item . path , collect = collect ) else : collect . append ( os . path . abspath ( item . path ) ) return collect