From e068a64994353437bbf0adb2eea63147ca4d7b5a Mon Sep 17 00:00:00 2001 From: Mark Powers Date: Sat, 14 Nov 2020 20:09:18 -0600 Subject: Remove leading 0 from Thoreau date --- on_this_day.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/on_this_day.py b/on_this_day.py index ca0f8e5..ff4d31d 100644 --- a/on_this_day.py +++ b/on_this_day.py @@ -76,9 +76,10 @@ def get_thoreau(): year_int = int(date.today().strftime("%Y")) - 183 year = str(year_int) year_stop = str(year_int+1) - month_day1 = date.today().strftime("_%b %d._") - month_day2 = date.today().strftime("_%b. %d._") - with open("journal1.txt") as f: + month_day1 = date.today().strftime("_%b %-d._") + month_day2 = date.today().strftime("_%b. %-d._") + filename = config["thoreau"]["journal1"] + with open(filename) as f: lines = f.readlines() # Find lines that the year lies on -- cgit v1.2.3