[Tutor] Fwd: Re: Dynamic variables changed via Tkinter button

Peter Otten __peter__ at web.de
Sun Apr 19 10:55:21 EDT 2020


Alan Gauld via Tutor wrote:

[Jon Davies]

> Thanks for your both of your responses. Having reviewed your responses,
> I have now made the respective changes and I have a working solution!

Congrats!

One final remark: true internationalisation has many traps waiting for the 
unsuspecting programmer. There is a Python project that tries to wrap the 
differences nicely:

>>> babel.numbers.format_currency(1234.56, 'USD', locale='en_US')
'$1,234.56'
>>> babel.numbers.format_currency(1234.56, 'USD', locale='de_DE')
'1.234,56\xa0$'

Comma and dot swapped places with the country, and the currency symbel went 
from start to end of the string. "\xa0" is a NO-BREAK SPACE:
>>> print(_)
1.234,56 $

You might at least take a look at

http://babel.pocoo.org/en/latest/index.html 




More information about the Tutor mailing list