3rd August 2019, 15:50
|
#472
| Link
|
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
|
Quote:
Originally Posted by ChaosKing
Maybe it is easier to use locale https://docs.python.org/2/library/locale.html -> locale.setlocale(locale.LC_ALL, 'en_us')
Python returns this on a german Windows 10:
python -c "import locale; print(locale.localeconv())"
Code:
{'int_curr_symbol': '', 'currency_symbol': '', 'mon_decimal_point': '', 'mon_thousands_sep': '', 'mon_grouping': [], 'positive_sign': '', 'negative_sign': '',
'int_frac_digits': 127, 'frac_digits': 127, 'p_cs_precedes': 127, 'p_sep_by_space': 127, 'n_cs_precedes': 127,
'n_sep_by_space': 127, 'p_sign_posn': 127, 'n_sign_posn': 127, 'decimal_point': '.', 'thousands_sep': '', 'grouping': []}
|
That is a really horrible idea. Now imagine using VS from inside an application that itself sets the locale to something in order to work. You've now broken everything.
LIBRARIES MUST NEVER MODIFY GLOBAL APPLICATION STATE
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
|
|
|