#Programming Language

204 posts

PySide6 in Practice #8 Release Polish: Icons, Versioning, Signing, GitHub Actions
5 min read

PySide6 in Practice #8 Release Polish: Icons, Versioning, Signing, GitHub Actions

The series finale: finishing the app into something you can hand to others. Managing icons, names, and resources with a PyInstaller spec file, defining the version in one place and feeding it to the app and the build, why unsigned apps get blocked on download and the lay of macOS notarization and Windows signing, a GitHub Actions matrix that builds for three operating systems, and a retrospective of the whole series.

PySide6 in Practice #7 Testing: pytest-qt and a Per-Layer Strategy
4 min read

PySide6 in Practice #7 Testing: pytest-qt and a Per-Layer Strategy

Dismantling the belief that GUI apps are hard to test, using the layer structure: why Qt-free core tests should be the most numerous, verifying the repository against a temp-file database, how pytest-qt's qtbot manages QApplication and the event loop for you, testing a model's contract (rowCount, data, setData), waiting on signals with waitSignal and widget interaction tests, and running Qt tests headless in CI.

PySide6 in Practice #6 The Settings Screen: QSettings, Dark Theme, Data Backup
4 min read

PySide6 in Practice #6 The Settings Screen: QSettings, Dark Theme, Data Backup

Handing the hardcoded decisions to the user: how QSettings stores values in each platform's standard location and its type traps, wiring the settings screen to live behavior (reminder hour, close-button action), dark and light themes via stylesheet swapping with system-theme detection, and the final piece of respecting user data — CSV export and database backup.

PySide6 in Practice #5 Tray Residency and Reminders: An App That Survives Its Window
5 min read

PySide6 in Practice #5 Tray Residency and Reminders: An App That Survives Its Window

Implementing the residency that turns a habit tracker into a real tool: putting an icon and menu in the system tray with QSystemTrayIcon, converting window close into hide via closeEvent and the UX debate around it, sending daily reminders at a set hour with QTimer, the limits and platform differences of tray notifications, and single-instance handling that prevents two copies of the app.

PySide6 in Practice #4 The Stats Screen: Painting a Contribution Heatmap with QPainter
5 min read

PySide6 in Practice #4 The Stats Screen: Painting a Contribution Heatmap with QPainter

Drawing the screen no stock widget provides: keeping statistics logic (completion rate, streaks) in the Qt-free core layer where it stays testable, painting a GitHub-style heatmap widget with paintEvent and QPainter, coordinate math and size handling with sizeHint, hit-testing the cell under the mouse for tooltips, and the custom-widget rule that repaints are requested through update().

PySide6 in Practice #3 The Today Screen: A Custom Model and Check Toggling
4 min read

PySide6 in Practice #3 The Today Screen: A Custom Model and Check Toggling

Building the app's first real screen: why stuffing items directly into a list widget hits its limits fast in real apps, subclassing QAbstractListModel to connect the repository to the view, exposing multiple faces of data through roles, the path a check toggle travels from view through model to database, updating views precisely with the dataChanged signal, and the add-habit dialog.

PySide6 in Practice #2 The SQLite Data Layer: Repository Pattern and Migrations
5 min read

PySide6 in Practice #2 The SQLite Data Layer: Repository Pattern and Migrations

Building the app's memory: why SQLite is the default for desktop apps, finding the OS-specific app-data folder correctly, designing the habits and checks schema, the repository pattern that confines SQL to one place, and the tiny user_version-based migration scheme that keeps user data intact across app updates.

PySide6 in Practice #1 Project Design: App Architecture Through a Habit Tracker
4 min read

PySide6 in Practice #1 Project Design: App Architecture Through a Habit Tracker

First post of a hands-on series that takes a PySide6 beginner all the way to a finished app: what we build (a local habit tracker) and why this subject, breaking feature requirements into screens, splitting code into UI, core, and data layers and why, uv-based project setup, and the main-window skeleton that will carry the next seven parts.

NumPy Fundamentals: Why Arrays Beat Python Lists, and How to Use Them
6 min read

NumPy Fundamentals: Why Arrays Beat Python Lists, and How to Use Them

NumPy, the foundation of Python data work, from first principles: the memory layout that makes Python lists inherently slow and how ndarray fixes it, vectorized operations that eliminate loops, the broadcasting rules that let differently-shaped arrays compute together, the trap of slices being views rather than copies, reading aggregations through the axis concept, and the cases where NumPy is the wrong tool.

Working with JSON in Rust: A Practical serde Deserialization Guide
4 min read

Working with JSON in Rust: A Practical serde Deserialization Guide

serde, Rust's standard for JSON, organized in working order: struct deserialization starting from one derive line, Option and default for real-world JSON with missing fields, rename_all to bridge camelCase APIs, feeling out unknown JSON with Value, enums with tag and untagged for responses that come in several shapes, and reading positions out of error messages.

Building Python Extension Modules with PyO3: From maturin Build to Wheel Publishing
4 min read

Building Python Extension Modules with PyO3: From maturin Build to Wheel Publishing

Walking the path Polars, Ruff, and pydantic proved: rewrite only Python's bottleneck function in Rust. The project structure maturin new creates, exposing Rust functions to Python with #[pyfunction] and #[pymodule], the maturin develop cycle, the type conversion rules (str, list, dict), the fit with free-threaded Python, and wheel builds through PyPI publishing.

Box vs Rc vs Arc: Rust Smart Pointers and When to Use Which
4 min read

Box vs Rc vs Arc: Rust Smart Pointers and When to Use Which

Collecting the IOU the basics course left to The Book. The three situations that need Box (recursive types, dyn traits, moving large values), Rc and reference counting for multiple owners, Arc for crossing threads, RefCell and interior mutability with runtime borrow checking, and the working idioms Rc<RefCell<T>> and Arc<Mutex<T>> — with the selection criteria as a decision sequence.