$ show pythonguis/pythonguis-examples
This repository is a comprehensive collection of over 1000 Python GUI example applications and tutorials, spanning multiple frameworks: PyQt5, PyQt6, PySide2, PySide6, Tkinter, Kivy, DearPyGui, Flet, NiceGUI, and Streamlit. It serves as an educational resource for developers learning desktop GUI programming, with step-by-step tutorials and full demo applications like calculators, media players, web browsers, games (Minesweeper, Solitaire), paint programs, and data-driven apps (weather, currency, crypto). The codebase is organized by framework, with each framework containing tutorials, demos, and reusable custom widgets. While the examples are functional and well-documented, the repository suffers from massive duplication across Qt bindings (identical logic replicated four times with minor API adaptations), some deprecated API usage (e.g., QWebEnginePage.NavigationType in Qt6, fixer.io API endpoints), and occasional cross-binding import errors. The most valuable parts are the self-contained custom widgets in the widgets/ directories, which demonstrate clean signal-based design and can be extracted into other Qt projects with minimal modification.
The LLM identified 5 files worth highlighting for reuse:
A custom QWidget that displays a vertical bar with colored segments (dial-like) using QPainter. It emits a valueChanged signal when the user clicks/drags, and supports setting colors, bar count, and steps. The widget is self-contained, imports only Qt modules, and can be dropped into any PyQt6/PySide6 project as a power meter or level indicator. Demonstrates custom painting and signal-slot architecture.
An animated toggle switch widget that inherits QAbstractButton. It uses a QPropertyAnimation for smooth sliding and color transitions. Supports state toggling with mouse clicks and emits toggled signal. The widget is purely paint-based (no images) and can be reused as a modern toggle button in any Qt application. Demonstrates property animation and custom painting.
A custom password input field that extends QLineEdit with a toggleable visibility button (eye icon). Users can show/hide the password by clicking the embedded button. The widget uses a QAction to add the button to the line edit's trailing position. It is self-contained, imports only Qt modules and SVG icons, and can be reused in any login form. Demonstrates line edit customization and action-based button placement.
A custom range slider widget that provides two handles (minimum and maximum) on a horizontal slider. Users can drag either handle to select a numeric range. It emits a rangeChanged signal with min/max values. The widget handles handle collision and boundary enforcement. It is self-contained and can be reused as a range selector in filtering UIs or any application requiring a numeric range input.
Demonstrates the QRunnable + QThreadPool pattern for offloading background tasks without freezing the UI. The Worker class is defined with a WorkerSignals QObject that emits finished, progress, and error signals. This pattern is reused across many demos (weather, crypto, unzip) and can be extracted as a reusable async task runner for any Qt application. Example_003 shows a long-running task with progress reporting.