I want to create a Python3 programm that contains a Tkinter Scale. And I want it to scale it in percent from 0(left) to 100 (middle) and back to 0 (on the right). How do I get rid of the '-' without breaking the code? Here's what I got so far:
Here's what I got so far:
#!/usr/bin/python3
import tkinter as tk
from tkinter import ttk
...
scale = tk.Scale(root, from_=-100, to=100, orient="horizontal", length=300, sliderlength=10)
...
it does nearly what I want, but I want to count from 0 to 100 and back to to 0.
If you want to show the current value above the slider from 0 to 100 to 0, you can set
showvalue=0and use another label to show the value you want:Note that the above solution just change the value displayed but the value returned by
scale.get()is still from -100 to 100.Result: