摘要: import os n = 0 for root, dirs, files in os.walk('./'): for name in files: if name[-3:] !='txt': n += 1 print('正在删除第',n,'个文件,','其名为:',name) os.remove( 阅读全文
posted @ 2020-10-15 14:34 hangover 阅读(572) 评论(0) 推荐(0)
摘要: # -*- coding:utf-8 -*- import os path = os.getcwd() #获取当前路径 count = 0 count1 = 0 for root,dirs,files in os.walk(path): #遍历统计 for each in files: count 阅读全文
posted @ 2020-10-15 11:17 hangover 阅读(659) 评论(0) 推荐(0)