22 lines
431 B
Python
22 lines
431 B
Python
|
import os
|
||
|
import json
|
||
|
|
||
|
with open("topics/shema.tex","r") as f:
|
||
|
shema=f.read()
|
||
|
|
||
|
|
||
|
for fn,fno in [[f"dics/{zw}",zw.replace(".json","")] for zw in os.listdir("dics")]:
|
||
|
print(fno)
|
||
|
with open(fn,"r") as f:
|
||
|
dic=json.loads(f.read())
|
||
|
ac=shema.replace("##name##",fno)
|
||
|
for key,val in dic.items():
|
||
|
ac=ac.replace(f"##{key}##",str(val))
|
||
|
|
||
|
|
||
|
with open(f"topics/{fno}.tex","w") as f:
|
||
|
f.write(ac)
|
||
|
|
||
|
|
||
|
|