# -*- coding: utf-8 -*- import os def file_name(file_dir): with open("SelectAllFiles.txt","w") as f: for root, dirs, files in os.walk(file_dir,topdown=True): for name in files: f.write(name+‘\n‘) if __name__=="__main__": file_name(os.getcwd())
标签:coding walk with == getc 读取 import roo os.walk
# -*- coding: utf-8 -*- import os def file_name(file_dir): with open("SelectAllFiles.txt","w") as f: for root, dirs, files in os.walk(file_dir,topdown=True): for name in files: f.write(name+‘\n‘) if __name__=="__main__": file_name(os.getcwd())
标签:coding walk with == getc 读取 import roo os.walk
原文地址:https://www.cnblogs.com/kuangxiangnice/p/8462508.html