Skip to content

Graphical User Interface (GUI) projects developed in Python using the native Tkinter library.

License

Notifications You must be signed in to change notification settings

TheNarratorVIMMXX/PythonTkinter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

📚 Tkinter Practices - Python GUI

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 Information

  • 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

📋 Project Contents

This project is a series of progressive exercises ranging from basic concepts to more complex applications with Tkinter:

🔹 Basic Practices (1-5)

  • 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

🔹 Data Input and Forms (6-7)

  • Practice 6: Entry with button to display entered name
  • Practice 7: Interactive questionnaire with multiple input fields

🔹 Organization with Frames (8-9)

  • Practice 8: 4-frame grid pattern (2x2) with different colors
  • Practice 9: Nested frames with internal button

🔹 Advanced Interactivity (10-11)

  • Practice 10: Move a Label horizontally with buttons
  • Practice 11: Selection list (Listbox) with selected item display

🔹 Complete Applications (12-14)

  • 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

🎯 Learning Objectives

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 command and bind()
  • ✅ Organization with Frame and nested frames
  • ✅ Data input validation
  • ✅ Using timers with after()
  • ✅ Pop-up messages with messagebox
  • ✅ Advanced customization (colors, fonts, styles)

🚀 Featured Highlights

Practice 13: Automatic Traffic Light

  • Realistic traffic light simulation with three lights (red, yellow, green)
  • Automatic changes every 5 seconds
  • Visual timer with countdown
  • Design using Canvas for graphical representation

Practice 14: Complete Calculator

  • 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

📦 Requirements

Python 3.x
tkinter (included in standard Python installations)

▶️ How to Run

  1. Clone this repository:
git clone https://github.com/yourusername/tkinter-practices.git
cd tkinter-practices
  1. Run any practice directly:
python practice_01.py
python practice_14.py  # Complete calculator

📚 Key Concepts Learned

  1. Layout Management: Differences between pack(), grid(), and place()
  2. Event-Driven Programming: Event handling with callbacks
  3. Data Validation: Using try-except blocks for user input
  4. Global State: Managing global variables to maintain state
  5. Timers and Animation: Using after() for temporal operations
  6. Best Practices: Documentation, descriptive names, logic separation

📄 License

This project is educational in nature and is available for free use for learning purposes.


🤝 Contributions

If you're a student and want to add more practices or improve existing ones, contributions are welcome!


📧 Contact


⭐ If this repository was helpful, don't forget to give it a star on GitHub!

Releases

No releases published

Packages

No packages published

Languages