set_locale¶
-
astropy.utils.misc.
set_locale
(*args, **kwds)[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 http://stackoverflow.com/questions/18593661/.
Parameters: name : str
Locale name, e.g. “C” or “fr_FR”.