Tkinter Scale slider with float values doesn't work with locale of language that uses comma for floats

Viewed 1650

I have following code:

import Tkinter as tk
import locale
from Tkinter import *
#locale.setlocale(locale.LC_NUMERIC, 'pl_PL')
master = tk.Tk()
w = tk.Scale(master, from_=0.05, to=0.1, resolution=0.01)
w.pack()
tk.mainloop()

And the slider works like it should. It doesn't slide when I uncomment that line with locale setting. That is probably due to the fact, that pl_PL locale uses comma for float separation. This may be a bug. How can I work around it so I can have the locale set properly?

1 Answers
Related