diff --git a/2020/new.py b/2020/new.py index 0b8632c..029d26a 100755 --- a/2020/new.py +++ b/2020/new.py @@ -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}")