DEV Community

Cover image for PyQT vs wxPython: Which GUI module for your project?
amigos-maker
amigos-maker

Posted on • Updated on

PyQT vs wxPython: Which GUI module for your project?

PyQT vs wxPython: Which of them should you use for your project?

Lets examine these two Python modules for making GUIs (Graphical User Interfaces).

What is Python?

Python is a high level, interpreted and general-purpose programming language. It is a popular programming language which can do both object oriented programming and scripting.

Even though it was first designed and developed in the year 1990 (29 years ago) by Guido van Rossum, it just recently had its stable release in the month of October, year 2019.

#!/usr/bin/python3
print "Hello World"

Python has been a popular programming language over the years and is loved by programmers for its emphasis on code readability, and its notable use of whitespace which enables programmers write logical codes for small scale and large-scale projects.

Before you make a GUI, you should know the Python basics.

GUI: Graphical User Interface

There are many frameworks which have helped provide a GUI (Graphic User Interface) for python, and all of them have their various pros and cons in different areas as well as their functionality, but two of the most important interfaces are the PyQT and wxPython.

Now, as a programmer, which is better for you? Is there any notable difference between the two of them? And the all important question: Which one should you use for your project?

an app made with wxwidgets

This article aims to answer all of these questions, by breaking them into different categories for the purpose of comparison:

Look

The overall aesthetics might not seem important, but it is the first thing a person notices when the application is turned on.

For PyQt, it is written in C++ like wxPython, but it does not use native widgets like the wxPython does.

What it does instead is to create approximations of widgets depending on the detected Operating system (OS) while the wxPython has core libraries which are present as wrappers around the native widgets of the operating system.

The PyQt makes good approximations of widgets, so good in fact, that it is almost impossible to find a user (not even art students) complain about how the PyQt does not look or feel native.

pyqt

On the other hand, the wxPython does not need to make approximations as it gives you the exact object you coded with its native tools.

wxpython gui

Installation process

The steps and effort required to install an application is very important, especially if it is an interface you wish to distribute to people to use.

For PyQt, installation is easier than taking candy from a baby. All you have to do is get a link to download, install the downloaded package and you're using the application before you know it.

For wxPython, installation on Linux and windows is easy, but very hectic on the Mac OS.

Layout

The layout of PyQt is quite simple. The widgets are named reasonably, e.g. QPushButton, QDial, etc.

In wxPython, that the foundational widget in the wxPython is the wx.Window, and everything, whether it is a push button, dial or checkbox is located in the wx.Window class.

Both wxPython and PyQt support grid layouts and absolute positioning.

PyQt has a GUI WYSIWYG builder named qt designer which lets you drag and drop your widgets.

pyqt designer

While wxPython does have some designers (wxGlade, boa-constructor), they are nowhere near as user friendly and usable (in my opinion).

Which is better?

Depends. The wxPython is simple to use and solutions can be easily created when it is not simple. However, the PyQt is big and has a lot of convenience that comes with this size.

Before you make the choice on the interface to use or recommend, remember that both of them are good, solid GUIs, but are different by design and useful in different situations.

Resources:

Top comments (0)