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.
17 lines
434 B
17 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:
|
|
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))
|
|
|