mirror of
https://github.com/Rushilwiz/math381.git
synced 2025-04-09 22:10:18 -04:00
19 lines
421 B
Python
Executable File
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) |