Open In App

Python Tkinter – SpinBox

Python offers multiple options for developing GUI (Graphical User Interface). Out of all the GUI methods, tkinter is the most commonly used method. It is a standard Python interface to the Tk GUI toolkit shipped with Python. Python with tkinter is the fastest and easiest way to create the GUI applications. Creating a GUI using tkinter is an easy task.

Note: For more information, refer to Python GUI – tkinter



Spinbox widget

The Spinbox widget is used to select from a fixed number of values. It is an alternative Entry widget and provides the range of values to the user.

Syntax:
The syntax to use the Spinbox is given below.



w = Spinbox ( master, options)

Parameters:

Options:
Following are commonly used Option can be used with this widget :-

Methods:
Methods used in this widgets are as follows:

Example:




from tkinter import *
  
root = Tk()
root.geometry("300x200")
  
w = Label(root, text ='GeeksForGeeks', font = "50"
w.pack()
  
sp = Spinbox(root, from_= 0, to = 20)
sp.pack()
  
root.mainloop() 

Output:

Article Tags :