PyQt (Python and Qt) and wxPython - GUI comparison
Archive - Originally posted on "The Horse's Mouth" - 2010-04-28 19:26:31 - Graham Ellis
We're running a tailored 3 day Python course at present, using Python 3 if it's practical, and today we compared the two contenders for the "Top GUI" prize - that's Python with Qt (PyQt) and wxPython. Now wxPython isn't yet available in Python 3, but PyQt is - although some of the documentation refers to the C interface rather then the Python one as yet.
Here's an example of a Qt application that's got a selector box in which you can pull down a menu, then a button you can click on to vote, with the vote being appended to a file. Source code [here]. It's using Qt4, and it shows the basics. There's no pretence of the code being tidy or well commented, nor the application being robust - it's definitely a "show you the mechanism" example.
And in contrast, here's the same functionality in a wxPython application - selector box, buttons, labels, etc. Source code - once again neither tidy nor robust but rather "shows you how" - [here].
The look and feel is very different - partly because the GUIs are shown on a Mac and a Windows platform and both of these Python GUIs inherit their style from the native graphics of the host operating system (a good thing, as it makes for consistent windows on each user's computer).
So which do I recommend / which will our customer be using? In their particular case, they need to start doing things and having elementary code up and running very rapidly, and then they'll be revisiting the code year after year in an educational environment. As it's running in Python 3.1, and they want to start and remain with Python 3, their decision is to go with Qt. For others, the decision will be less clear cut.