Scale with python

 from tkinter import *



def submit():
    print(f"The temprature is: {scale.get()} degree C")



window = Tk()
scale = Scale(window, from_ = 100to = 0,fg="red",bg="black",width=100,tickinterval=10,orient=VERTICAL,length=500,)
scale.set(30)
scale.pack()
scale_btn = Button(window,text = "Submit",command=submit,activeforeground="red",bg="black",fg="red",width=20)
scale_btn.pack()
window.mainloop()

Comments