Widgets, layouts, and grouping
17-minute lesson · module-gui-02
You are previewing this course as a guest
Read anything and run any exercise you like. It all runs in your own browser, so nothing here is saved: no XP, no progress, and the AI tutor needs an account. Sign in and your work starts counting.
Widgets, layouts, and grouping
17-minute lesson · module-gui-02
- Create the common widgets Label, Button, and Entry.
- Read text the user typed into an Entry with .get().
- Arrange widgets with the pack and grid layout managers.
- Group related widgets inside a Frame to organize a window.
Source attribution
Status: adapted
How to Think Like a Computer Scientist: Interactive Edition — source · GUI and Event Driven Programming / Widgets / Layout Managers / Widget Grouping
Adaptation notes. Read-along lesson. tkinter needs a native window and a running event loop, which the Pyodide sandbox lacks, so there is no graded coding step. Code is for reading and local running. The name-form example is ours; prose is original.
License notes. Original chapter is GNU FDL 1.3 (Brad Miller, David Ranum, and the upstream Elkner/Downey/Meyers text). No verbatim text reproduced.