pywebview shows HTML, CSS, and JavaScript in a native desktop window from Python using OS webview backends. It adds window management, events, an optional built-in HTTP server, and Python–JavaScript messaging.
Overview
pywebview is a lightweight native webview wrapper that displays HTML in a dedicated GUI window so desktop apps can use web front ends without exposing the embedded browser chrome.
It targets Windows, macOS, Linux with GTK or Qt, and Android, using WinForms on Windows, Cocoa on macOS, and Qt or GTK on Linux. Frozen apps avoid bundling a large GUI toolkit, keeping executables smaller.
Advanced pieces include window manipulation, an event system, a built-in HTTP server, native menus and dialogs, two-way JavaScript and Python communication, and DOM access from Python.
Additional native libraries may be required on some platforms. Installation docs, examples, and a React boilerplate are available for faster UI setup.
Key features
- Native OS webview windows
- JavaScript, HTML, CSS UI
- Built-in HTTP server
- Python and JavaScript messaging
- Window and event APIs
- Native menus and dialogs
- DOM access from Python
- GTK, Qt, Cocoa, WinForms backends
Use cases
- Building Python desktop apps with web UI
- Wrapping internal tools in a native window
- Prototyping GUIs with familiar web stacks
- Shipping small frozen Python utilities