import os
import re
import time
import glob
import subprocess
for compressfile in glob.glob(r'D:\DaNingLog\hardware\*.7z'):
cmd =['7z','e',compressfile]
subprocess.Popen(cmd)
time.sleep(10)
for extractfile in glob.glob(r'D:\DaNingLog\hardware\WORK*'):
f=open(extractfile)
source=f.read()
f.close()
r=r'051ARIV'
s=len(re.findall(r,source))
print extractfile
print "051ARIV occur times:",s
python 2.7批量解压and解压文件查找关键字
最新推荐文章于 2024-08-17 22:35:31 发布