python 得到文件下所有文件

28 阅读1分钟

得到文件夹下所有文件:

def get_image_path(path):
    
    path_list = []
    filenames = os.listdir(path)
    for filename in filenames:
        a = os.path.join(path, filename)
        path_list.append(a)
        
    return path_list

iamge_list = get_image_path(floder)