Mercurial > hg > cc > azure
view master/bin/finalMerge.py @ 68:1f04bce6ead7 default tip
use basefile instead of transferfile, and remove cleanup: belt and braces wrt lossage of sac_schemes.py in 15% of 1000_k3,
this as used in a_2
author | Henry S. Thompson <ht@markup.co.uk> |
---|---|
date | Thu, 04 Jun 2020 20:44:44 +0000 |
parents | beae6309d4ec |
children |
line wrap: on
line source
#!/usr/bin/env python3 import sys,re mh={} ms={} mm={} for (i,m) in enumerate(['0','Jan','Feb','Mar','Apr','May','Jun', 'Jul','Aug','Sep','Oct','Nov','Dec']): mm[m]=i for l in sys.stdin: (h,m,y,c)=l.split() if h=='http': tab=mh else: tab=ms m=mm[m] key='%s\t%s'%(m,y) tab[key]=tab.get(key,0)+int(c) for (l,tab) in zip(['http','https'],[mh,ms]): for (k,v) in tab.items(): print(l,k,v,sep='\t')