May-14-2024, 02:50 PM
When trying to execute code from IDLE, I can't get the system locale data on macOS
But If I'll use bash, I get it
1 2 3 4 |
import os ret = os.popen( 'locale' ) ret.read().split() [ 'LANG=' , 'LC_COLLATE="C"' , 'LC_CTYPE="UTF-8"' , 'LC_MESSAGES="C"' , 'LC_MONETARY="C"' , 'LC_NUMERIC="C"' , 'LC_TIME="C"' , 'LC_ALL=' ] |
Output:Air:~ admin$ python3
Python 3.7.9 (default, Jan 3 2021, 01:35:12)
[Clang 10.0.0 (clang-1000.10.44.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> ret = os.popen('locale')
>>> ret.read().split()
['LANG="ru_RU.UTF-8"', 'LC_COLLATE="ru_RU.UTF-8"', 'LC_CTYPE="ru_RU.UTF-8"', 'LC_MESSAGES="ru_RU.UTF-8"', 'LC_MONETARY="ru_RU.UTF-8"', 'LC_NUMERIC="ru_RU.UTF-8"', 'LC_TIME="ru_RU.UTF-8"', 'LC_ALL=']
>>>
Why is this happening and how could I get the locales?