next day (day of the week)
day after that (day of the week)
This works wonderfully until you hit about 7pm. At 7pm the forecast flips from giving you the current day's forecast to the next day's forecast. This is because the information from NOAA being pulled is based on UTC and not a local time zone. So to eliminate any confusion in the evening, I thought it would be nice to add the name of the day of the week for the Today and Tomorrow forecasts.
Insert days of the week section I simply added a DAY_ONE and DAY_TWO variable. Here is what it looks like:
one_day = datetime.timedelta(days=1)
days_of_week = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
output = output.replace('DAY_ONE',days_of_week[(day_one + 0*one_day).weekday()]).replace('DAY_TWO',days_of_week[(day_one + 1*one_day).weekday()]).replace('DAY_THREE',days_of_week[(day_one + 2*one_day).weekday()]).replace('DAY_FOUR',days_of_week[(day_one + 3*one_day).weekday()])
I also noticed the DAY_ONE day was being cut off when the actual day of the week was being inserted so I had to play around a bit with the x axis placement. I also opted for a left anchor as well which pulled the day over a little. I might play around and move it some more if it bothers me, but for now I'm happy with the placement.
Original post with tutorial:Kindle Weather Display
Kindle Weather Display Github Repository
Or if you prefer, download directly from dropbox