Halo9Pan
1/16/2014 - 11:04 PM

How to get all files in the folder with python

How to get all files in the folder with python

def get_all_files(folder):
    file_list = []
    if os.path.exists(folder):
        for root, dirs, files in os.walk(folder):
            for file in files:
                file_list.append(os.path.join(root,file))
    return file_list