You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
434 B

import os
preH = open("pre.h", "r").read()
preCpp = open("pre.cpp", "r").read()
for dayNum in range(1, 26):
pad = f'{dayNum:02}'
dirName = f"src/days/{pad}"
try:
os.mkdir(dirName)
except OSError:
3 years ago
pass
with open(f"{dirName}/Day{pad}.h", "w") as file:
file.write(preH.replace("XX", pad))
with open(f"{dirName}/Day{pad}.cpp", "w") as file:
file.write(preCpp.replace("XX", pad))