TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Using Spin Box Widget In Python GUI Application
Prakashraj P
Mar 16, 2020
10
k
0
1
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
In this blog, I am going to create spin box in Python GUI application,
Introduction
In this blog, I am going to create a spin box in Python GUI application. When a user clicks “up” and “down” box arrows, the number count will increase and decrease on the application screen.
Software requirement
Python 3.5 and IDLE (Python 3.5)
Programming code
import
tkinter as tk
from
tkinter
import
ttk
from
tkinter
import
Spinbox
win = tk.Tk()
#Add a Title
win.title(
"Python GUI App"
)
#Label
ttk.Label(win, text=
"Choose the Number:"
).grid(column=
1
,row=
1
)
#spinbox
spin=Spinbox(win,from_=
0
,to=
100
,width=
10
,bd=
5
)
spin.grid(column=
1
,row=
2
)
#Calling Main()
win.mainloop()
About the code
First, I am importing the tkinter modules.
Next, assign a class and variables and give the application title.
Next, I create the spin box 0 to 100.
Finally, I have started the windows event loop by calling the mainloop method then execute the code.
Then, let’s execute the code.
Output
Python GUI
Next Recommended Reading
Using Combobox Widget In Python GUI Application