[Tutor] Floating point error in tkinter

Válas Péter sulinet at postafiok.hu
Sat Mar 10 20:40:54 CET 2012


Sorry for sending it in private first, Steven drew my attention to it. This
list has a strange setting, I got used to lists that send replies
automatically to list, and did not notice the error.

2012. március 9. 18:53 Válas Péter írta, <sulinet at postafiok.hu>:

> 2012/3/9 Steven D'Aprano <steve at pearwood.info>
>
>>
>> What makes you think it is a Python bug? Is there something that makes
>> you expect that Tkinter should accept strings with commas instead of
>> floats?
>>
> Better to say: I think it is a Tkinter bug (unless we expect Windows to
> adapt itself to Python), and Tkinter is part of the Python dstribution
> AFAIK. As you may see, Tkinter is the only module to appear in the error
> message. We may say it is a Windows bug, but this is the case of the
> elephant and the mouse. :-)
>
>
>> The error message is pretty clear: tkinter is expecting a float, but
>> receiving a string instead.
>>
> No; it receives a float formatted by Hungarian standards as set in control
> panel of Windows, and does not recognize it as a float.
>
>
>>
>> import locale
>> locale.setlocale(locale.LC_ALL, 'english_us')
>>
> That's what I definitely wouldn't like to do, because I *do need*Hungarian locale very much for everything else. Too big a price.
>
> VP
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20120310/2a44adde/attachment.html>


More information about the Tutor mailing list