Using the following command I was able to get the numerical day of the week for a given date:
from calendar import weekday
print(weekday(2015, 5, 8))
This block then produces the number 4. How can I convert this into Friday, preferably just using the calendar library. I've looked through the documentation as best as I can but couldn't find anything that would print out the full day name.
Cheers.
You can use calendar.day_name which is a list of week days in current locale:
>>> import calendar
>>> calendar.day_name[4]
'Friday'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With