I am trying to get the values from two sliders after their values have been set and then use those values to create a new variable which is their quotient. The code that I found uses a function that will print the values, but I need to get the values returned to the main body of the program so that I can create the new variable and it is not working. from tkinter import *
def show_values():
altitude =w2.get()
speed = w1.get
print (w1.get(), w2.get())
return altitude,speed #return variables
master = Tk()
w1 = Scale(master, from_=0, to=42) #slider 1
w1.pack()
w2 = Scale(master, from_=0, to=200, orient=HORIZONTAL) #slider 2
w2.pack()
Button(master, text='Show', command=show_values).pack() #call function
#to get slider
time = altitude/speed
mainloop()