¡@

Home 

python Programming Glossary: locale.setlocale

Umlauts in regexp matching (via locale?)

http://stackoverflow.com/questions/12240260/umlauts-in-regexp-matching-via-locale

most involving setting locales but up to now to no avail. locale.setlocale locale.LC_ALL 'de_DE.UTF 8' re.findall r' w ' 'abc def g xfci..

How can I print a float with thousands separators?

http://stackoverflow.com/questions/13082620/how-can-i-print-a-float-with-thousands-separators

improve this question Use locale.format import locale locale.setlocale locale.LC_ALL 'German' 'German_Germany.1252' print locale.format.. locale.str etc. and leave other locale settings unaffected locale.setlocale locale.LC_NUMERIC 'English' 'English_United States.1252' print.. print locale.format ' .2f' 32757121.33 True 32 757 121.33 locale.setlocale locale.LC_NUMERIC 'German' 'German_Germany.1252' print locale.format..

How do I use Python to convert a string to a number if it has commas in it as thousands separators?

http://stackoverflow.com/questions/1779288/how-do-i-use-python-to-convert-a-string-to-a-number-if-it-has-commas-in-it-as-th

way python share improve this question import locale locale.setlocale locale.LC_ALL 'en_US.UTF 8' locale.atoi '1 000 000' # 1000000..

how to print number with commas as thousands separators in Python 2.x

http://stackoverflow.com/questions/1823058/how-to-print-number-with-commas-as-thousands-separators-in-python-2-x

improve this question I got this to work import locale locale.setlocale locale.LC_ALL 'en_US' 'en_US' locale.format d 1255000 grouping..

RFC 1123 Date Representation in Python?

http://stackoverflow.com/questions/225086/rfc-1123-date-representation-in-python

locale process wide then you can do import locale datetime locale.setlocale locale.LC_TIME 'en_US' datetime.datetime.utcnow .strftime '..

Python not sorting unicode properly. Strcoll doesn't help

http://stackoverflow.com/questions/3412933/python-not-sorting-unicode-properly-strcoll-doesnt-help

2.5.1 and 2.6.5 on OSX as well as on Linux. import locale locale.setlocale locale.LC_ALL 'pl_PL.UTF 8' print i for i in sorted u'a' u'z'..

How do I sort a list of strings in Python?

http://stackoverflow.com/questions/36139/how-do-i-sort-a-list-of-strings-in-python

you can specify a custom locale for sorting import locale locale.setlocale locale.LC_ALL 'en_US.UTF 8' # vary depending on your lang locale..

What's the easiest way to add commas to an integer in Python? [duplicate]

http://stackoverflow.com/questions/3909457/whats-the-easiest-way-to-add-commas-to-an-integer-in-python

and country codes. All you need to do is import locale locale.setlocale locale.LC_ALL '' # empty string for platform's default setting..

What is the correct way to set Python's locale?

http://stackoverflow.com/questions/955986/what-is-the-correct-way-to-set-pythons-locale

for the locale module gives this example import locale locale.setlocale locale.LC_ALL 'de_DE' When I run that I get this Traceback most.. are different there. Take a more precise look at the doc locale.setlocale locale.LC_ALL 'de_DE' # use German locale name might vary with.. platform On Windows I think it would be something like locale.setlocale locale.LC_ALL 'deu_deu' MSDN has a list of language strings..

Locale date formatting in Python

http://stackoverflow.com/questions/985505/locale-date-formatting-in-python

a d b Y H M S Sun 23 Oct 2005 20 38 56 import locale locale.setlocale locale.LC_TIME sv_SE # swedish 'sv_SE' print time.strftime a..