Skip to content

Lesson 05 · Desktop Apps with Python & Qt

Desktop: Packaging & Distribution

Ship it: turn a folder of Python into a double-clickable artifact per platform with PyInstaller - what --onefile and --windowed really do, bundling data files and icons, and the honest costs of SmartScreen, notarization and antivirus false positives.

Prerequisites: Desktop: Files, Dialogs & Settings

Learning objectives
By the end of this lesson, you will be able to:
  • Explain what a shippable artifact is on each platform - an .exe on Windows, an .app bundle on macOS, an AppImage on Linux - and why 'just install Python' is not an answer
  • Freeze an app with PyInstaller using --onefile, --windowed and --name, and state precisely what each flag changes about the build
  • Bundle data files and icons with --add-data and --icon, and locate bundled data at runtime through sys._MEIPASS in a way that still works from source
  • Run a release test on a clean machine against the packaged artifact alone, and record its result as pass/fail lines
  • Budget the honest costs of distribution up front: bundle size, slower startup, antivirus false positives, and the signing and notarization tolls per platform