Day-7 AdvPython WS
Day-7 AdvPython WS
GUI Programming
Tkinter Overview
● Tkinter is Python's standard GUI (Graphical User Interface) package.
● It is a thin object-oriented layer on top of the Tk GUI toolkit.
● Tk means toolkit
● Tkinter is included with standard installs of Python, So you need not to use pip install
tkinter.
Creating window
Widgets are the elements in a GUI application, like buttons, labels, and text boxes. To place
widgets inside a window, we use geometry managers like pack(), grid(), and place().
Change font of the text
Change label color
● Use label.config
● fg for foreground color
● bg for background color
Pack options
Numeric Widgets
● Numeric widgets allow users to input numbers.
● Common numeric widgets include Scale and Spinbox.
Example: Scale Widget
Example: Spinbox Widget
Boolean Widgets
Boolean widgets represent boolean values (True/False).
The most common boolean widgets are Checkbutton and Radiobutton.
Example: Checkbutton Widget