import os path = r"C:\Users\dong\Desktop\data\2006\2006\SciVis"; for root,dirs,files in os.walk(path): print(dirs) for name in dirs: print(name) filelist=os.listdir(os.path.join(root,name)) for ffiles in filelist: if 'test' in ffiles: os.re
path = r"C:\Users\dong\Desktop\data\2006\2006\SciVis";
for root,dirs,files in os.walk(path):
print(dirs)
for name in dirs:
print(name)
filelist=os.listdir(os.path.join(root,name))
for ffiles in filelist:
if 'test' in ffiles:
os.remove(os.path.join(root,name,ffiles))
【文章原创作者:香港云服务器 http://www.558idc.com/ne.html 复制请保留原URL】