[FAQ] "Best" GUI toolkit for python

Mark Summerfield list at qtrac.plus.com
Tue Oct 18 03:42:39 EDT 2016


PySide/PyQt

On Windows I use Python 3.4 + PySide 1.2.4 (Qt 4.8). I have found this
very reliable and use it for both my personal projects and for my
commercial products. I don't use a GUI design tool but you could use Qt
Designer to visually draw your GUI since PySide can read the .ui files it
outputs.

Eventually PySide 2 will be available, and that will support Qt 5 (for what that's worth) and presumably Python 3.5+ (which I look forward to).

Gtk/PyGObject/PyGI

Windows is in no way a first class platform for this, so I wouldn't use
it. (I wouldn't use it on any other platform either: I think the introspection idea is excellent and wish Qt had done it; but I personally really dislike the direction Gtk has gone in recent years.)

Tkinter

This is okay for many simple use cases. However, creating custom widgets in
Tkinter is non-trivial to say the least (especially compared with say, PySide or wxPython), and there is no support for _editable_ styled text. (If someone can prove me wrong I'd be glad to know how to edit text in Tkinter and toggle bold, italic, underline, super- and sub-script, font family, font size, and color. I can do most of these - but not all, and haven't seen any other code that can do them all either. Note that I'm not talking here about syntax highlighting but rather word-processor-style styling.)

wxPython

I've heard some people say they use Python 3 + Phoenix successfully.
On the plus side it uses the native widgets so has a native look and feel.
But what I find frustrating is that there are many widgets with
overlapping functionality so it isn't clear which one is the best to use.

For Windows specifically, you could use https://pythonnet.github.io/
This gives you access to the CLR so you should be able to use a lot of
stuff you're familiar with from VB; some of which might even work on Linux
with the Mono runtime.

A completely different cross-platform approach is to use a web browser as
the GUI toolkit. For example:
https://github.com/r0x0r/pywebview + https://github.com/dddomodossola/remi
or https://flexx.readthedocs.io/en/stable/

There are other toolkits too, e.g.,
http://pybee.org/project/projects/libraries/toga/
(but this has very little documentation)

Or

https://kivy.org/#home

And there are more (e.g., libui, IUP, SDL2).

Good luck!



More information about the Python-list mailing list