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]