wx.html2.WebView as 'Electron for Python'?

Electron (electronjs.org) is a cool way to ‘Build cross-platform desktop apps with JavaScript, HTML, and CSS’ including Atom, Discord, Slack, Twitch, etc.

Some JavaScript is likely inevitable (alas), but I’d much prefer my main app logic to be in Python. Does wx.html2.WebView plus related wxPython widgets suffice?

The context: I’d like to create an inexpensive app for a niche market that is not computer savvy. Installation and usage should feel like a regular desktop app, preferably with no additional downloads required. Must support MacOS (my dev platform) and Windows. Linux would be nice in theory but not sure there will be any demand in this niche.

Some questions for MacOS:

  • do I include a browser component in the app? If so, how does the user get security updates?
  • … or: if my app just references the OS, what are the chances my app breaks with an OS update?
  • Apple’s WebView looks deprecated (support thru 10.14 Mohave) in favor of WKWebView … is that an issue?

And for Windows:

  • can I bundle MS Edge WebView2 in the app? If so, can I specific ‘evergreen’ vs. ‘fixed’; I might want to offer a version with each. Webview2 - Microsoft Edge Developer Or: would users have to download from that page?

And in general:

  • Any other pros/cons of wxPython vs. Electron?


On the Mac the wx.html2.WebView is built on top of the system’s webview components, so it should always be available. Since it is such an important component I expect that incompatibilities from updates would be rare. Apple isn’t as good at maintaining backwards compatibility as MS is however, so the chance of issues is probably not 0%.

You can probably embed the MS installer in your installer, and then invoke it at the end of your installation before exiting.