Simplify new script
This commit is contained in:
parent
5bc5c4042e
commit
a6e7e49dca
|
@ -4,9 +4,11 @@ import os
|
||||||
from datetime import date
|
from datetime import date
|
||||||
|
|
||||||
TEMPLATE = """\
|
TEMPLATE = """\
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
with open("{}", "rt") as f:
|
lines = [line.rstrip() for line in sys.stdin]
|
||||||
lines = [line.rstrip() for line in f.readlines()]
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
@ -15,5 +17,5 @@ if __name__ == "__main__":
|
||||||
|
|
||||||
day = date.today().day
|
day = date.today().day
|
||||||
with open(f"day{day}.py", "wt") as f:
|
with open(f"day{day}.py", "wt") as f:
|
||||||
f.write(TEMPLATE.format(f"day{day}.txt"))
|
f.write(TEMPLATE)
|
||||||
os.system(f"python ../fetch.py {day}")
|
os.system(f"python ../fetch.py {day}")
|
||||||
|
|
Loading…
Reference in a new issue