Introduction to
Tkinter
Advantages
Disadvantages
Key Points:
• Standard Library: Tkinter comes bundled with
Python, so no installation is required
• .Cross-Platform: Tkinter applications will run on
Windows, Mac, and Linux.
• Widgets: Tkinter provides various controls, such
as buttons, labels, and text boxes, used in a GUI
application.
First Tkinter
Program
Explanation:
tk.Tk(): Creates the main application
window.
tk.Label(): Creates a label
widget.
label.pack(): Adds the label to the window.
root.mainloop(): Starts the Tkinter event loop,
which waits for user interaction.
Widgets
Widgets are the building blocks of a Tkinter application.
Common widgets include:
Label: Displays text or images.
Button: Executes a function when clicked.
Entry: Allows the user to input text.
Text: Multi-line text input.
Checkbutton: Checkbox widget.
Geometry
Management
Tkinter uses geometry managers
to control the layout of widgets
within a window.
The main geometry managers
are pack, grid, and place.
pack: Packs widgets into the window in order.
grid: Arranges widgets in a grid (row and column).
place: Places widgets at an absolute position.
Any Doubt
…….Doubt hai to pooch Lo…….
Thank You