Add new day script
This commit is contained in:
parent
8b035ab9b6
commit
958cc852f3
19
2020/new.py
Executable file
19
2020/new.py
Executable file
|
@ -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}")
|
|
@ -1,7 +0,0 @@
|
||||||
def main():
|
|
||||||
with open("", "rt") as f:
|
|
||||||
lines = [line.rstrip() for line in f.readlines()]
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
main()
|
|
Loading…
Reference in a new issue