[Tutor] Floating point error in tkinter

Válas Péter sulinet at postafiok.hu
Fri Mar 9 14:09:23 CET 2012


Hi,

I use a tkinter-based editor that ran properly earlier on English Windows
XP. Now I use Hungarian Windows 7 with Python 2.7.2. You must know that in
Hungary decimal fractions are marked with a decimal comma, not a dot (e.g.
pi=3,1415...).

I suspect it somehow gets a Hungarian decimal from Windows and can't
understand it. So when I page up and down with PgUp/PgDn buttons, it works
well. When I use the wheel on mouse, it's OK, too. But when I try to use
the vertical scrollbar of the window with mouse, error messages flood my
screen and it won't work. Dou you think this is a Python bug? Shall I make
a bugreport or just some config setting is missing?

Exception in Tkinter callback
Traceback (most recent call last):
  File "c:\python27\lib\lib-tk\Tkinter.py", line 1410, in __call__
    return self.func(*args)
  File "c:\python27\lib\lib-tk\Tkinter.py", line 1444, in yview
    res = self.tk.call(self._w, 'yview', *args)
TclError: expected floating-point number but got "0,0016"
Exception in Tkinter callback
Traceback (most recent call last):
  File "c:\python27\lib\lib-tk\Tkinter.py", line 1410, in __call__
    return self.func(*args)
  File "c:\python27\lib\lib-tk\Tkinter.py", line 1444, in yview
    res = self.tk.call(self._w, 'yview', *args)
TclError: expected floating-point number but got "0,0033"
Exception in Tkinter callback
Traceback (most recent call last):
  File "c:\python27\lib\lib-tk\Tkinter.py", line 1410, in __call__
    return self.func(*args)
  File "c:\python27\lib\lib-tk\Tkinter.py", line 1444, in yview
    res = self.tk.call(self._w, 'yview', *args)
TclError: expected floating-point number but got "0,0049"
Exception in Tkinter callback
Traceback (most recent call last):
  File "c:\python27\lib\lib-tk\Tkinter.py", line 1410, in __call__
    return self.func(*args)
  File "c:\python27\lib\lib-tk\Tkinter.py", line 1444, in yview
    res = self.tk.call(self._w, 'yview', *args)
TclError: expected floating-point number but got "0,0066"
Exception in Tkinter callback
Traceback (most recent call last):
  File "c:\python27\lib\lib-tk\Tkinter.py", line 1410, in __call__
    return self.func(*args)
  File "c:\python27\lib\lib-tk\Tkinter.py", line 1444, in yview
    res = self.tk.call(self._w, 'yview', *args)
TclError: expected floating-point number but got "0,0082"
Exception in Tkinter callback
Traceback (most recent call last):
  File "c:\python27\lib\lib-tk\Tkinter.py", line 1410, in __call__
    return self.func(*args)
  File "c:\python27\lib\lib-tk\Tkinter.py", line 1444, in yview
    res = self.tk.call(self._w, 'yview', *args)
TclError: expected floating-point number but got "0,0098"
Exception in Tkinter callback
Traceback (most recent call last):
  File "c:\python27\lib\lib-tk\Tkinter.py", line 1410, in __call__
    return self.func(*args)
  File "c:\python27\lib\lib-tk\Tkinter.py", line 1444, in yview
    res = self.tk.call(self._w, 'yview', *args)
TclError: expected floating-point number but got "0,0098"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20120309/cae3c029/attachment.html>


More information about the Tutor mailing list