explaingit

r0x0r/pywebview

5,884PythonAudience · developerComplexity · 2/5Setup · easy

TLDR

A Python library that wraps any web page or HTML file in a native desktop window, write your app UI as HTML, CSS, and JavaScript, and pywebview shows it as a real borderless window using the OS built-in web renderer.

Mindmap

mindmap
  root((pywebview))
    What it does
      Native window for web UI
      Cross-platform
      No browser chrome
    Tech stack
      Python
      HTML CSS JS
      OS web renderers
    Features
      Python JS bridge
      File dialogs
      Native menus
    Platforms
      Windows macOS
      Linux
      Android
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Build a desktop app with a web-based UI backed by Python logic, without shipping a bundled browser engine.

USE CASE 2

Wrap an existing web app into a native window with no browser chrome for distribution as a desktop tool.

USE CASE 3

Create a desktop tool where Python code and JavaScript in the page call each other directly.

USE CASE 4

Ship a cross-platform desktop app on Windows, macOS, Linux, and Android from a single Python codebase.

Tech stack

PythonHTMLCSSJavaScriptGTKQTWinFormsCocoa

Getting it running

Difficulty · easy Time to first run · 5min

Install with pip, uses the OS built-in web renderer so no large browser engine is bundled.

In plain English

pywebview is a Python library that lets you build desktop applications using web technologies: HTML, CSS, and JavaScript. Instead of learning a native GUI toolkit, you write your app's interface as a web page, and pywebview displays it in a real window on the user's screen. The window looks like a native app from the outside, with no visible browser chrome, address bar, or browser controls. Under the hood, pywebview uses each operating system's built-in web rendering component. On Windows it uses WinForms with the system web view, on macOS it uses Cocoa, and on Linux it uses either GTK or QT. Because it uses whatever the OS already provides, you do not have to bundle a large browser engine with your app, which keeps the download size small. Android is also supported. Beyond just displaying a web page, pywebview provides two-way communication between the Python side and the JavaScript running in the page. Python code can call JavaScript functions, and JavaScript in the page can call Python functions. The library also includes a built-in HTTP server, window management controls, and native UI elements like menus and file dialogs. Getting started is simple. Install it with pip, then write a few lines of Python to create a window pointing at an HTML file or a URL. A hello-world example that opens a window is three lines of code. Documentation, a gallery of examples, and a React starter template are all linked from the README. The project is actively maintained and accepts financial contributions through GitHub Sponsors, Patreon, and Open Collective. The original author also offers paid consulting services for projects that need deeper support.

Copy-paste prompts

Prompt 1
I want to build a desktop app using pywebview where Python handles the business logic and HTML handles the UI. Show me a working example where a button in the web page calls a Python function and updates the DOM with the result.
Prompt 2
Using pywebview, create a simple desktop file browser where Python reads the directory listing and passes it to a JavaScript frontend to display.
Prompt 3
How do I package a pywebview app into a standalone Windows executable using PyInstaller?
Prompt 4
Write a pywebview app that opens a local HTML form and exposes a Python function that saves submitted data to a SQLite database.
Prompt 5
Show me how to add a native menu bar with File and Help menus to a pywebview window on macOS.
Open on GitHub → Explain another repo

← r0x0r on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.