This repository contains a collection of 14 educational practices developed with Tkinter, Python's standard library for creating graphical user interfaces (GUI). The practices were completed as part of the programming course at CBTis No. 128.
- Student: Magallanes López Carlos Gabriel
- School: Centro de Bachillerato Tecnológico Industrial y de Servicios No. 128
- Group: 3° "J"
- Completion Date: October 15-16, 2025
This project is a series of progressive exercises ranging from basic concepts to more complex applications with Tkinter:
- Practice 1: Basic 1000x500 window
- Practice 2: Window with custom title and background color
- Practice 3: Label with custom styles (font, colors, padding)
- Practice 4: Button that prints messages to the terminal
- Practice 5: Button that changes Label text
- Practice 6: Entry with button to display entered name
- Practice 7: Interactive questionnaire with multiple input fields
- Practice 8: 4-frame grid pattern (2x2) with different colors
- Practice 9: Nested frames with internal button
- Practice 10: Move a Label horizontally with buttons
- Practice 11: Selection list (Listbox) with selected item display
- Practice 12: Simple addition calculator with error validation
- Practice 13: Traffic light simulator with automatic changes and timer
- Practice 14: Complete basic calculator with arithmetic operations, keyboard support, and validation
These practices cover the following fundamental Tkinter concepts:
- ✅ Window creation and configuration (
Tk()) - ✅ Basic widgets:
Label,Button,Entry,Listbox,Canvas - ✅ Geometry managers:
pack(),grid(),place() - ✅ Event handling with
commandandbind() - ✅ Organization with
Frameand nested frames - ✅ Data input validation
- ✅ Using timers with
after() - ✅ Pop-up messages with
messagebox - ✅ Advanced customization (colors, fonts, styles)
- Realistic traffic light simulation with three lights (red, yellow, green)
- Automatic changes every 5 seconds
- Visual timer with countdown
- Design using
Canvasfor graphical representation
- Basic arithmetic operations (+, -, *, /)
- Support for parentheses and decimals
- Keyboard shortcuts (Enter, Escape, Backspace)
- Expression validation with error handling
- Modern interface with differentiated colors for each button type
- Delete and clear screen buttons
Python 3.x
tkinter (included in standard Python installations)- Clone this repository:
git clone https://github.com/yourusername/tkinter-practices.git
cd tkinter-practices- Run any practice directly:
python practice_01.py
python practice_14.py # Complete calculator- Layout Management: Differences between
pack(),grid(), andplace() - Event-Driven Programming: Event handling with callbacks
- Data Validation: Using
try-exceptblocks for user input - Global State: Managing global variables to maintain state
- Timers and Animation: Using
after()for temporal operations - Best Practices: Documentation, descriptive names, logic separation
This project is educational in nature and is available for free use for learning purposes.
If you're a student and want to add more practices or improve existing ones, contributions are welcome!
- Author: Carlos Gabriel Magallanes López
- Email: cgmagallanes23@gmail.com
- School: CBTis No. 128
⭐ If this repository was helpful, don't forget to give it a star on GitHub!