其他语言的 Python 月/日名称

MrG*_*ole 8 python local python-2.7

Debian 设置为en_US,但我需要德语的日/月。

那么我怎样才能得到%a输出Do而不是呢Thu

draw.text((0,34), time.strftime("%a %d.%m.%Y"), font=font)
Run Code Online (Sandbox Code Playgroud)

Rol*_*ony 14

Linux

>>> import datetime
>>> import locale
>>> locale.setlocale(locale.LC_TIME, 'de_DE.UTF-8')
'de_DE.UTF-8'
>>> d = datetime.datetime.now()
>>> d.strftime("%a %d.%m.%Y")
'Do 24.05.2018'
>>> 
Run Code Online (Sandbox Code Playgroud)