summaryrefslogtreecommitdiffstats
path: root/gen_exercises.py
blob: dc5856043ef46521c6abbd12de0301bc1f284d58 (plain)
1
2
3
4
5
6
7
8
9
10
11
from string import Template
import sys

with open(sys.argv[1]) as fh:
    template = Template(fh.read())

for i in xrange(1, 11):
    lh = "lh" + str(i) + ".ily"
    rh = "rh" + str(i) + ".ily"
    with open(str(i) + ".ily", "w") as fh:
        fh.write(template.substitute(title=i, lh=lh, rh=rh))