locale

The locale module provides access to the POSIX locale database, which allows programmers to handle certain cultural issues in an application without knowing all the specifics of each country where the software is executed. A “locale” defines a set of parameters that describe the representation of strings, time, numbers, and currency. These parameters are grouped into the following category codes:

CategoryDescription
LC_CTYPECharacter conversion and comparison.
LC_COLLATEString sorting. Affects strcoll() and strxfrm().
LC_TIMETime formatting. Affects time.strftime().
LC_MONETARYFormatting of monetary values.
LC_MESSAGESMessage display. This may affect error messages returned by functions such as os.strerror().
LC_NUMERICNumber formatting. Affects ...

Get Python: Essential Reference, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.