Python Locale Module
Internationalization — setlocale, getlocale, currency, strcoll. This category documents 10 Python locale module entries, and each page gives you the full syntax, the parameter list, the return value, and a runnable example. The entries include: locale.setlocale(), locale.getlocale(), locale.getdefaultlocale(), locale.strcoll(), locale.strxfrm(), locale.format_string(), locale.currency(), locale.atof(), locale.atoi(), locale.LC_ALL. locale.setlocale() sets the locale for a category (LC_ALL, LC_TIME, LC_NUMERIC, etc.). locale.getlocale() returns the current locale setting as (language, encoding). locale.getdefaultlocale() returns the default locale from environment variables. locale.strcoll() compares two strings according to the current LC_COLLATE locale. locale.strxfrm() transforms a string to one that can be used in locale-aware comparisons. Locale Module belongs to the Modules & Metadata group alongside Importlib Module, Pkgutil Module, Compileall Module, Zipapp Module. You can also search across every category from the search page, browse the complete A–Z index, or try any example in the Python playground.