Some good answers already make use of calendar but the effect of setting the locale hasn't been mentioned yet.
Calendar set month names according to the current locale, for exemple in French:
import locale
import calendar
locale.setlocale(locale.LC_ALL, 'fr_FR')
assert calendar.month_name[1] == 'janvier'
assert calendar.month_abbr[1] == 'jan'
If you plan on using setlocale
in your code, make sure to read the tips and caveats and extension writer sections from the documentation. The example shown here is not representative of how it should be used. In particular, from these two sections:
It is generally a bad idea to call setlocale() in some library routine, since as a side effect it affects the entire program […]
Extension modules should never call setlocale() […]