更新↑
import os,re,gzip
a=os.popen('ls STA.current/LNK/*/RPT/*overview*')
all_list=a.read().split('\n')
b=os.popen('ls STA.current/LNK/*/RPT/*gba.violators.late.rpt.gz')
setup_gba_list=b.read().split('\n')
c=os.popen('ls STA.current/LNK/*/RPT/*gba.violators.early.rpt.gz')
hold_gba_list=c.read().split('\n')
def GetEartlyLateSlack(a,b,c):
p=re.compile('Path Groups:\s({'+a+'}|{'+b+r'}).*?Slack Time\s+(.*?)\n',re.S)
#print(p.pattern)
for i in range(len(c)-1):
f=gzip.open(c[i],'r')
l=f.read()
m=p.findall(l)
if m:
sum=0
print(c[i])
#print(m)
for j in range(len(m)):
sum=float(m[j][1])+sum
print('WNS: '+str(m[0]