Sliders in Tkinter using Scale() | python Tkinter Gui tutorial

 Sliders in Tkinter using Scale() | python Tkinter Gui tutorial

from tkinter import *
import tkinter.messagebox as tmsg
root = Tk()
root.geometry("455x233")
root.title("Slider tutorial")

def getdollar():
print(f"We have credited {myslider2.get()} dollar to your bank acc.")
tmsg.showinfo("Dollar",f"We have credited {myslider2.get()} dollar to your bank acc.")

# myslider = Scale(root, from_=0, to=100)
# myslider.pack()
Label(root, text="how many dollars do you want?").pack()
myslider2 = Scale(root, from_=0, to=100, orient=HORIZONTAL)
Button(root, text="Get dollars!", command= getdollar).pack()
myslider2.pack()

root.mainloop()

Output