Mercurial > hg > cc > azure
diff master/src/wecu/sac_reducer.py @ 61:cfaf5223b071
trying to get my own mapper working
author | Henry S. Thompson <ht@markup.co.uk> |
---|---|
date | Sun, 31 May 2020 12:06:44 +0000 |
parents | 5fdca5baa4e9 |
children | 892e1c0240e1 |
line wrap: on
line diff
--- a/master/src/wecu/sac_reducer.py Thu May 28 12:55:03 2020 +0000 +++ b/master/src/wecu/sac_reducer.py Sun May 31 12:06:44 2020 +0000 @@ -1,8 +1,10 @@ -#!/usr/bin/python +#!/usr/bin/python3 import sys from collections import defaultdict +print('reducing',sys.argv,file=sys.stderr) + if sys.argv[1] == 'by-file': # Show results by file for line in sys.stdin: @@ -17,9 +19,11 @@ k = line[0] v = line[1] except: + print('bogus',line,file=sys.stderr) continue counters[k] += int(v) - for k in counters: - print("{}\t{}".format(k, counters[k])) + print('nc',len(counters),file=sys.stderr) + for k,v in counters.items(): + print("{}\t{}".format(k, v))