import os
n = 0
for root, dirs, files in os.walk('./rar/data'): #specify directory
for name in files:
if(name =='test.txt'): #specify file name
n += 1
print(n)
os.remove(os.path.join(root, name))
import os
n = 0
for root, dirs, files in os.walk('./rar/data'): #specify directory
for name in files:
if(name =='test.txt'): #specify file name
n += 1
print(n)
os.remove(os.path.join(root, name))
Post comment 取消回复