PyQT vs wxPython: Which GUI module for your project?
Tags: python, pyqt, wxpython, desktop
Published: 2019-11-01 12:08:54

---
title: PyQT vs wxPython: Which GUI module for your project?
cover_image: https://cdn.pixabay.com/photo/2019/10/28/07/44/goldcrest-4583628_960_720.jpg
tags: python, pyqt, wxpython, desktop
published: true
---
<a href="https://riverbankcomputing.com/software/pyqt/intro/">PyQT</a> vs <a href="https://www.wxpython.org/">wxPython</a>: Which of them should you use for your project?

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

### What is Python?

<a href="https://python.org">Python</a> 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 <a href="https://pythonbasics.org">Python basics</a>.

## GUI: Graphical User Interface

There are many frameworks which have helped provide a <a href="https://pythonspot.com/gui/">GUI (Graphic User Interface)</a> 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?

<img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fwww.wxwidgets.org%2Fabout%2Fscreenshots%2Fcars-hotsurf-msw.png&f=1&nofb=1" alt="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 <a href="https://riverbankcomputing.com/software/pyqt/intro/">PyQt</a>, it is written in C++ like <a href="https://www.wxpython.org/">wxPython</a>, 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. 

<img src="https://external-content.duckduckgo.com/iu/?u=http%3A%2F%2Fqt.developpez.com%2Fdoc%2F4.6%2Fimages%2Fcalendarwidgetexample.png&f=1&nofb=1" alt="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.

<img src="https://external-content.duckduckgo.com/iu/?u=http%3A%2F%2Fwww.codeproject.com%2FKB%2FMFC%2FUltimateToolbox_Skins%2FUTBStyle2003.jpg&f=1&nofb=1" alt="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. 

<img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fwww.seppemagiels.com%2Fsites%2Fdefault%2Ffiles%2Fimages%2Finstall-qt.png&f=1&nofb=1">

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 <a href="https://pythonpyqt.com/pyqt-grid-layout/">grid layouts</a> and absolute positioning.

PyQt has a GUI WYSIWYG builder named <a href="https://pythonbasics.org/qt-designer-python/">qt designer</a> which lets you drag and drop your widgets. 

<img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fi.stack.imgur.com%2F79FdX.png&f=1&nofb=1" alt="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:**

* <a href="https://gum.co/pysqtsamples">Course: Create Python PyQt desktop apps</a>
* <a href="https://pythonbasics.org/pyqt-hello-world/">PyQt hello world, an introduction</A>
* <a href="https://pythonspot.com/wxpython-window/">wxPython tutorial</a>