import os def get_files_recursion_from_dir(path): print(f"当前文件夹:{path}") file_list = [] if os.path.exists(path): for f in os.listdir(path): new_path = path + "/" + f if os.path.isdir(new_path): file_list += get_files_recursion_from_dir(new_path) else: file_list.append(new_path) else: print(f"指定目录 {path} 不存在") return [] return file_list if name == "main": print(get_files_recursion_from_dir("D:/Python/picture/eas1yocr"))
本文作者:a
本文链接:
版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!