math381/homework

19 lines
421 B
Python
Executable File

#!/usr/bin/env python3
from string import Template
import os
import sys
i = input("What number homework is it? ")
d = input("What is the due date (e.g. September 12)? ")
s = {
'number': i,
'date': d
}
with open(f'hw/.template/template.tex', 'r') as f:
src = Template(f.read())
result = src.substitute(s)
os.mkdir(f'hw/hw{i}')
with open(f'hw/hw{i}/hw{i}.tex', 'w') as f:
f.write(result)