Posts

Showing posts from August, 2026

MicroPython _thread exercise

The purpose of this exercise is to test the behavior of MicroPython _thread, specifically for Raspberry Pi Pico series, whether _thread.start_new_thread() can provide real multi-core parallel speedup for pure Python CPU-bound work.  mpy_thread_smp_bench.py # mpy_thread_smp_bench.py # # Purpose: # Simple MicroPython benchmark to test whether _thread.start_new_thread() # can provide real multi-core parallel speedup for pure Python CPU-bound work. # # Method: # 1. Run a CPU-bound loop in the main thread and measure the duration. # This is the single-thread baseline. # # 2. Run the same CPU-bound loop in two threads: # - one in the main thread # - one in a newly created _thread # # 3. Measure: # - duration of thread 0 # - duration of thread 1 # - total wall-clock time from starting both threads until both finish # # Interpretation: # Let single-thread duration be T. # # If the two CPU jobs run fully in parallel on two cores: # tot...

Build a Python Slideshow App with PyQt6 and Package It as a Windows .exe

Image
In this post, we build a small desktop slideshow application with Python and PyQt6. The app lets you pick any folder through a built-in file explorer, then plays its contents as a slideshow — each image is displayed for 5 seconds, each video plays once, and a mouse click or touch tap skips to the next item. The walkthrough covers the full real-world workflow on Windows: create an isolated virtual environment, install PyQt6, run the app from source, and finally package everything into a single standalone .exe with PyInstaller — so the finished slideshow can run on any Windows PC, even one without Python installed. To create a Python virtual environment , enter in Command Prompt: python -m venv .venv Creates an isolated Python environment in a .venv folder, keeping this project's dependencies separate from the system-wide Python. (.venv is just a naming convention — any folder name works.) To activate it, enter: .venv\Scripts\activate.bat or .venv\Scri...