pywebview

使用 JavaScript、HTML 和 CSS 为你的 Python 程序构建 GUI。「Build GUI for your Python program with JavaScript, HTML, and CSS」

Github stars Tracking Chart

pywebview

https://pywebview.flowrl.com

pywebview 是一个轻量级的跨平台的 webview 组件封装器,它允许在自己的本地 GUI 窗口中显示 HTML 内容。它让你在桌面应用程序中拥有强大的 web 技术,隐藏了 GUI 是基于浏览器的事实。你可以将 pywebview 与一个轻量级的 web 框架(如 FlaskBottle)一起使用,或者单独使用 Python 和 DOM 之间的双向桥。

pywebview 使用原生 GUI 来创建一个 web 组件窗口。Windows 上的 WinForms、macOS 上的 Cocoa 和 Linux 上的 QT 或 GTK。如果你选择冻结你的应用程序,pywebview 不会捆绑一个沉重的 GUI 工具箱或 web 渲染器,以保持较小的可执行大小。pywebview 与 python3 兼容。

pywebview 是由 Roman Sirokov 创建的。由 Roman 和 Shiva Prasad 维护。

开始使用

安装

pip install pywebview

在 Linux 上,你需要额外的库。详情请参考安装页面。

Hello world

import webview
webview.create_window('Hello world', 'https://pywebview.flowrl.com/hello')
webview.start()

通过阅读 文档示例贡献 进一步探索 pywebview。如果 React 是你的菜,请马上开始使用 React boilerplate

(The first version translated by vz on 2020.08.22)

Main metrics

Overview
Name With Ownerr0x0r/pywebview
Primary LanguagePython
Program languagePython (Language Count: 8)
PlatformLinux, Mac, Windows
License:BSD 3-Clause "New" or "Revised" License
所有者活动
Created At2014-11-20 11:05:46
Pushed At2025-06-30 12:07:02
Last Commit At2025-06-20 04:37:50
Release Count73
Last Release Name5.4 (Posted on )
First Release Name0.5 (Posted on )
用户参与
Stargazers Count5.3k
Watchers Count65
Fork Count592
Commits Count2.2k
Has Issues Enabled
Issues Count1128
Issue Open Count19
Pull Requests Count338
Pull Requests Open Count4
Pull Requests Close Count66
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

https://pywebview.flowrl.com

pywebview is a lightweight cross-platform wrapper around a webview component that allows to display HTML content in its own native GUI window. It gives you power of web technologies in your desktop application, hiding the fact that GUI is browser based. You can use pywebview either with a lightweight web framework like Flask or Bottle or on its own with a two way bridge between Python and DOM.

pywebview uses native GUI for creating a web component window: WinForms on Windows, Cocoa on macOS and QT or GTK on Linux. If you choose to freeze your application, pywebview does not bundle a heavy GUI toolkit or web renderer with it keeping the executable size small. pywebview is compatible with Python 3.

pywebview is created by Roman Sirokov. Maintained by Roman and Shiva Prasad.

Getting started

Install

pip install pywebview

On Linux you need additional libraries. Refer to the installation page for details.

Hello world

import webview
webview.create_window('Hello world', 'https://pywebview.flowrl.com/hello')
webview.start()

Explore pywebview further by reading documentation, examples or contributing. If React is your thing, get started right away with React boilerplate.

Contributors

Code Contributors

This project exists thanks to all the people who contribute. [Contribute].

Financial Contributors

Become a financial contributor and help us sustain our community. More donation options are outlined on the Donating page.

Individuals

Organizations

Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]