li26598296 发表于 2017-4-26 08:49:37

Python 国际化

  


>>> help(locale)
Help on module locale:
NAME
locale - Locale support.
FILE
c:\python27\lib\locale.py
DESCRIPTION
The module provides low-level access to the C lib's locale APIs
and adds high level number formatting APIs as well as a locale
aliasing engine to complement these.
The aliasing engine includes support for many commonly used locale
names and maps them to values suitable for passing to the C lib's
setlocale() function. It also includes default encodings for all
supported locale names.
>>> import locale
>>> locale.setlocale(locale.LC_ALL, "")
"Chinese (Simplified)_People's Republic of China.936"
>>> lang, encoding = locale.getdefaultlocale()
>>> print lang
zh_CN
>>> print encoding
cp936
>>>
 
页: [1]
查看完整版本: Python 国际化