platforms

Desktop apps

The same project builds a native Mac app and a native Windows app. No Electron and no web view.

terminal
pyxpo run desktop             # build, open and hot reload the native app
pyxpo build desktop           # build only
pyxpo run desktop --preview   # skip the native build, show the app in a browser window

Mac

On macOS, pyxpo run desktop builds the app with UIKit through Mac Catalyst, the same shell as iOS. Every component and module that works on iOS works here. It needs Xcode and the Catalyst slice of the CPython runtime, which the first build downloads. The first launch asks for any privacy permission the app uses, such as Photos or the camera, as on a phone.

Windows

On Windows, the same commands build a native WinUI 3 app at build/windows/<Name>/<Name>.exe. The shell is unpackaged and self-contained, so the folder runs from anywhere and needs no installer. CPython 3.13 runs on its own thread and sends the same ops as on iOS and Android; the shell draws them with XAML controls.

pyproject.toml
[tool.pyxpo.windows]
title = "My App"        # default: the app name
size = [1024, 768]      # window size at 100% display scale
  • Escape and the mouse back button act as the hardware back button. Ctrl+R reloads the app in dev.
  • Module calls run in the package's desktop.py backend, the same one the browser preview uses.
  • Known limits: custom font files, image tintColor, text shadows, ScrollView paging and bounce, and per-side border colors have no effect yet. A shadow needs a backgroundColor on the same view. There is no edge-swipe back gesture.

The Windows shell is not in the runtime release yet. Build it once with pwsh tools/build_windows_shell.ps1 from a pyxpo checkout (Visual Studio 2022 C++ tools, CMake, .NET 8 SDK and Python 3.13 x64), then set PYXPO_WINDOWS_DIST to its folder.

Browser preview

pyxpo run desktop --preview runs your Python on your computer and draws the app in a browser window. It needs no Xcode or Visual Studio and starts in seconds, which makes it the fastest loop for screen work. When the native toolchain is missing, for example on Linux, pyxpo run desktop uses the preview too. PYXPO_RENDERER=console uses a text renderer instead.

Layouts for big windows

Desktop windows are wide and resizable. Use breakpoints and layout components so a screen made for a phone becomes a centered page with columns on a desktop.