I combined this answer & this answer to come up with a script that outputs a different value every time a slider in tkinter is adjusted. It works but prints all of the values for the array and ideally only want to see the changed value. Could someone point me in the right direction?
import Tkinter as tk
scales=list()
Nscales=10
class App:
def __init__(self):
self.root = tk.Tk()
for i in range(Nscales):
self.slider = tk.Scale(self.root, from_=1, to=5, orient=tk.HORIZONTAL) # creates widget
self.slider.bind("<ButtonRelease-1>", self.updateValue)
self.slider.pack()
self.slider.set(3)
scales.append(self.slider) # stores widget in scales list
self.root.mainloop()
def updateValue(self, event):
for i in range(Nscales):
print ("Scale %d has value %d" %(i,scales[i].get()))
app=App()