You can get weekday names as follows:
import locale
locale.nl_langinfo(locale.DAY_1)
locale.nl_langinfo(locale.DAY_2)
locale.nl_langinfo(locale.DAY_3)
locale.nl_langinfo(locale.DAY_4)
locale.nl_langinfo(locale.DAY_5)
locale.nl_langinfo(locale.DAY_6)
locale.nl_langinfo(locale.DAY_7)
Still a little unsatisfactory that you cannot specify the day of the week as an integer variable. In my environment, you can do it like this:
locale.nl_langinfo(locale.DAY_1 + x)
but the documents do not guarantee it.
source
share