diff options
| author | Thibaut Horel <thibaut.horel@gmail.com> | 2013-08-16 11:26:43 +0200 |
|---|---|---|
| committer | Thibaut Horel <thibaut.horel@gmail.com> | 2013-08-16 11:26:43 +0200 |
| commit | e016d43307fedbc0825a7f0f03cbebede4e98f1b (patch) | |
| tree | 2514d7097b701a6ec93ed70dac9c994815ed812a /gen_exercises.py | |
| download | hanon-e016d43307fedbc0825a7f0f03cbebede4e98f1b.tar.gz | |
Initial commit
Diffstat (limited to 'gen_exercises.py')
| -rw-r--r-- | gen_exercises.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gen_exercises.py b/gen_exercises.py new file mode 100644 index 0000000..dc58560 --- /dev/null +++ b/gen_exercises.py @@ -0,0 +1,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)) |
