set_locale¶
-
astropy.utils.misc.
set_locale
(name)[source] [edit on github]¶ Context manager to temporarily set the locale to
name
.An example is setting locale to “C” so that the C strtod() function will use “.” as the decimal point to enable consistent numerical string parsing.
Note that one cannot nest multiple set_locale() context manager statements as this causes a threading lock.
This code taken from https://stackoverflow.com/questions/18593661/how-do-i-strftime-a-date-object-in-a-different-locale.
Parameters: - name : str
Locale name, e.g. “C” or “fr_FR”.