summaryrefslogtreecommitdiff
path: root/training/dpmert/divide_refs.py
blob: b478f918892f5f949410cd1ea19e05fec959fa83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env python
import sys

(numRefs, outPrefix) = sys.argv[1:]
numRefs = int(numRefs)

outs = [open(outPrefix+str(i), "w") for i in range(numRefs)]

i = 0
for line in sys.stdin:
  outs[i].write(line)
  i = (i + 1) % numRefs

for out in outs:
  out.close()