Python: Creating desktop application with HTML GUI

There is value in having a local server that does your GUI work, whether this applies in your case depends very much on the requirements of the app. Most apps I write tend to have a habit of ending up to be multi-user and hosted, so for me it makes absolute sense starting of like this.

If you are going down this route also have a look at http://brython.info/, having the same like languages across everything makes brain context switching less of an 'overhead' (pardon the pun).


Use PyQt or PySide 2, Qt WebEngine and Qt's builtin support for hosting HTML applications:

http://doc.qt.io/qt-5/qtwebchannel-index.html

The general architecture is a SPA (Single Page Application) running from local HTML and Javascript content bundled with your app – no need for bundling in a web server.

For anything complicated (like bypassing cross origin issues), use the Qt WebChannel to message to functionality built on the Python side.

This is basically the same architecture that Cordova uses.

Now, whether you should build an application this way (cough QML cough) is a completely different topic.

Tags:

Python