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