如何在python控制台中列出所有可用的Windows语言环境?

问题描述:

在linux上,我们可以使用locale -a查看可用的语言环境列表.

On linux we can use locale -a to see the list of locales available.

$ locale -a
C
C.UTF-8
en_US.utf8
POSIX 

是否可以在 windows 上的python控制台中执行相同的操作?

Is it possible to do the same from python console on windows?

当您尝试执行locale.setlocale(locale.LC_ALL, '???')并且只是不知道语言环境值的名称时,这可能会很方便.

This can be handy when you try to do locale.setlocale(locale.LC_ALL, '???') and simply don't know the name of the locale value.

>>> import locale
>>> locale.locale_alias