import os def get_file_list(_path): file_gen = os.walk(_path) file_list = [] for item in file_gen: if len(item[2]): for file in item[2]: file_list.append(os.path.join(item[0], file)) return file_list if __name__ == "__main__": result = get_file_list(r"E:\Backup\Tools\Normal\浏览器") for r in result: print(r)