reference generator

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/python
import sys
import random
if len(sys.argv) < 2:
print("give file name for generation")
exit(0)
fname = sys.argv[1] + ".strings"
fname_ref = sys.argv[1] + ".references"
ln = len( open(fname, "r").readlines())
f = open(fname_ref, "w")
for i in range(ln):
generated = []
for j in range(1, random.randint(2, 6)):
generated.append(1000000000*i + 1000000*j)
f.write(' '.join(str(e) for e in generated) + '\n')
f.close()