I used Pywebview for a project and had to contribute a few bug fixes to have it working right but it's been a pleasure to work with. Especially since it is fully supported by pyinstaller to build stand-alone executables that can then be distributed and easily used (simple double click) by people who otherwise wouldn't open a terminal, activate a python virtual environment, and then launch the program.
We tried using pywebview for a cross-platform desktop app when it was version 3.x and some of the features were limited, especially when it came to systray interactions. Will have to try it out again. In the end, for that specific project, we ended up settling on NeutralinoJS. Wails was another big contender but due to limited GoLang resources in-house, we decided not to use it. Reference: https://neutralino.js.org/
I've been using Pywebview for a couple of internals tools at work, on windows desktops. I had to install Edge WebView2 (cf. https://developer.microsoft.com/en-us/microsoft-edge/webview... ) because it wouldn't work without it, but apart from this, very easy to use.
Happy to see further improvements to this library !
You get to control the chrome a bit more - with Pywebview you can open something that looks like a regular application window, with the fact that it's HTML+CSS+JavaScript a hidden (from the user) implementation detail.
You can make Python functionality available to your custom JavaScript via a bridge. The bridge goes both ways - your Python application can trigger JavaScript to run inside the visible windows too.
Probably loads. It's an extra dependency so it adds complexity (though it does seem to be very cleanly designed from what I've seen so far). Stuff people do in Pywebview won't be added to their browser history, doesn't get access to their existing cookies, presumably doesn't work with password managers and browser extensions.
But if you want to give people a separate app experience it looks like a great option to me.
Conversely, it can also be very annoying when you accidentally select some of the UI text and you have to manually deselect it (or maybe you can't deselect it).
Are there any sizable examples without Javascript at all?
Also this uses a whole lot of custom code (and some DLLs vendored and created from the interop-native-packages...) to hook up to native Webviews (which might be fine for simple things, but so is tkinter), so this is not electron, where you get a specific verson of blink/whatever and build on that.
In addition, it uses heavy toolkits to get the webview (i.e. Kivy on Android and Qt on Linux) – all of which incidentally also support all the platforms. EDIT: it doesn't package them though...
So why multiply your problems: from GUI-framework Y on platform (X1,X2,X3) to GUI-framework (Y1,Y2,Y3)on platform (X1,X2,X3) using render-engine (Z1,Z2,Z3).
If you want to use the platform-browser anyway: why not create a small native shim (with Tkinter everywhere but Android) to control your server and package that?
To end on a very positive note: this is a herculean collection of tools to deploy Python GUIs on nearly any platform and as such seems like a very nice ressource if you want to do that!
Using Pywebview you can either use a "normal" web backend, e.g., using Flask to make a backend HTTP API, or you can expose Python code to make it callable "directly" (a more correct term would be "transparently") from JavaScript on the frontend side. In the latter case it's quite useful be able to update the DOM directly from Python :).
Author here. I have maintained pywebview for almost ten years, so yeah I would say it is production ready at this point :) New major version brings its own share of bugs, but most of those should have been ironed since 5.0
I would recommend wails (https://wails.io/) which is the same thing but for Go.
Nothing against this project it's just Python is not an optimal technology for shipping self-contained desktop apps.
You'll have to bundle the whole of Python distro which is very bloaty.
A Go will compile to a statically linked executable that only contains the code actually used in the app. Still not tiny but probably 10x smaller than packaged Python app.
And I used wails so can vouch that it works.
There's also an option for Rust (which I haven't used because I don't particularly want to learn Rust).
> which I haven't used because I don't particularly want to learn Rust
This is a good reason to not recommend libraries for other languages as a substitute. People are interested in pywebview because it's written for Python. They don't want to learn Go any more than you want to learn Rust.
> Nothing against this project it's just Python is not an optimal technology for shipping self-contained desktop apps.
"Optimal" is relative, and varies depending on a lot of factors that you don't have context for for OP's project. Even setting aside the value of being able to use a language you already know (which is hard to overstate), there are reasons you might want to use Python over Go.
For example: the last desktop app that I started integrates with a bunch of ML/LLM libraries that are, unsurprisingly, primarily written in and for Python. I could use Go and dive into FFI/IPC for the Python code, or I can just write the whole thing in Python and pywebview and figure out distribution [0]. I chose the latter.
A bundled, built standalone Python can be 16 to 32MB (including the full standard library, which you can strip down to just the bits you use to save size). Not tiny, but probably not worth switching programming languages over.
> You'll have to bundle the whole of Python distro which is very bloaty.
Python's embeddable package (for 64-bit Windows, available on the download page) is 23 MB uncompressed or 10.5 MB zipped. Although I'm sure Go can create smaller apps, I wouldn't call it "very bloaty".
There is a difference between speed and productivity and if you need to learn Go that can be a bigger problem than inefficiency. Also you should have a reason other that to change programming languages like this library versus walls like an actual speed test..:
On Windows it's webview that is Edge (based on Chrome).
On Mac it's webview based on Safari.
They re-use the executable that is already installed in the OS.
They don't provide all the features that Electron does but you can do anything that a modern browser can do + add OS specific things with backend code (written in Go or Python or Rust, depending on which project you use).