pywebview

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

Github星跟踪图

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)

主要指标

概览
名称与所有者r0x0r/pywebview
主编程语言Python
编程语言Python (语言数: 8)
平台Linux, Mac, Windows
许可证BSD 3-Clause "New" or "Revised" License
所有者活动
创建于2014-11-20 11:05:46
推送于2025-06-30 12:07:02
最后一次提交2025-06-20 04:37:50
发布数73
最新版本名称5.4 (发布于 )
第一版名称0.5 (发布于 )
用户参与
星数5.3k
关注者数65
派生数592
提交数2.2k
已启用问题?
问题数1128
打开的问题数19
拉请求数338
打开的拉请求数4
关闭的拉请求数66
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?

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]