Converting Flask into a Desktop App

How to Create an Electron-Like App with Python

Andrew Udell
codeburst

Photo by Carl Heyerdahl on Unsplash

From web development to data science, Python offers an incredibly diverse set of tools. Its easy-to-read syntax and quick learning curve makes it a popular language but it lacks the diverse and beautiful GUI support of web technologies. Anyone who’s used Flask, a popular and lightweight web framework, has probably wondered if they could take the same principles and apply them to desktop app development. The temptation of combining an HTML and CSS frontend with a Python backend is alluring,

A few libraries attempt to achieve this, but lack the customization options and don’t have a large community. Instead, the web engine module in the immensely popular Qt GUI library offers the same effect.

Qt for Python

As a toolset for creating cross-platform GUI’s with free and open-source licensing options, the Python bindings for Qt are quite popular among developers. While an entire tutorial could be written about all the modules and features of Qt, its web engine in particular can create an Electron-style app.

Built on top of a snapshot of Chromium, the Qt WebEngine is a fully developed browser capable of rendering HTML, CSS, and JavaScript. It’s easy to use and only requires a few lines to start using…

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Responses (2)

What are your thoughts?

Hi, this is a great solution.
Big question: How do you manage to kill the flask server after you close the Qt window?
Thanks

--

I can’t wait to try this !

--