1 # coding=utf-8 2 import os 3 4 n = 0 5 for root, dir, files in os.walk('.'): 6 for name in files: 7 if ("final" not in name): 8 n+=1 9 print(n,name) 10 os.remove(os.path.join(root,name))