diff --git a/2020/new.py b/2020/new.py new file mode 100755 index 0000000..a608c78 --- /dev/null +++ b/2020/new.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python3 + +import os +from datetime import date + +TEMPLATE = """ +def main(): + with open("{}", "rt") as f: + lines = [line.rstrip() for line in f.readlines()] + + +if __name__ == "__main__": + main() +""" + +day = date.today().day +with open(f"day{day}.py", "wt") as f: + f.write(TEMPLATE.format(f"day{day}.txt")) +os.system(f"python ../fetch.py {day}") diff --git a/2020/skel.py.txt b/2020/skel.py.txt deleted file mode 100644 index 732477d..0000000 --- a/2020/skel.py.txt +++ /dev/null @@ -1,7 +0,0 @@ -def main(): - with open("", "rt") as f: - lines = [line.rstrip() for line in f.readlines()] - - -if __name__ == "__main__": - main()