PyQt vs wxPython
Tags: python, desktop
Published: 2019-10-27 12:35:38

---
title: PyQt vs wxPython
cover_image: https://thepracticaldev.s3.amazonaws.com/i/azfej6mjh86ec37dsh9h.png
tags: python, desktop
published: true
---
Python is a well-liked programming language that can be used for both to make console apps and desktop software.

Specific frameworks offer a GUI or graphical interface for Python, but the two most frequently used are **wxPython** and **PyQt**. 

Let’s see up next how do those two frameworks compare, and which suits better your needs.

You should know the <a href="https://pythonbasics.org">basics of  Python</a> before trying to make GUIs.
 
## Advantages of wxPython

The most critical aspect of <a href="https://www.wxpython.org/">wxPython</a> is its particular characteristic related to main libraries designed in C++. 

When you create a something, let’s say a button or window, you won’t receive an item that seems like it should belong in another operating system. You receive, as a result, the object you coded with native tools.

<img src="https://thepracticaldev.s3.amazonaws.com/i/7zacuo3qsd5fnmsunxbp.png">

With wxPython, you might need to create several platform-specific changes to your GUI code, based on the object you are programming. 

As an example, think about the flickering associated with designing elements on Windows.You will need an attribute to double buffer the graphics to prevent it. And this is not present amongst default functionalities. 

Even though it might seem like a disadvantage of wxPython, it can be counteracted with a bit of mastering of specific allowances for wxPython.

<img src='https://external-content.duckduckgo.com/iu/?u=http%3A%2F%2Fimg.brothersoft.com%2Fscreenshots%2Fsoftimage%2Fw%2Fwxpython-224895-1237971617.jpeg&f=1&nofb=1' alt='wxpython'>

wxPython is excellent for installing on Linux or Windows, but the installation process on Mac OS can turn out to be troublesome. Also, even though wxPython gets you access to outstanding features, it does not come with the same flexibility as PyQt.
 
## Advantages of PyQt

Well, <a href="https://riverbankcomputing.com/software/pyqt/intro/">PyQt</a> is based on the popular Qt toolkit, and it is written with the aid of C++ (<a href="https://pythonprogramminglanguage.com/pyqt/">PyQt</a> is a Python binding to the Qt Framework). 

Yet a downside of this framework is that it *doesn’t use native widgets*. Instead, it leads to an approximation of widgets based on the type of OS detected. 

PyQt permits the necessary adjustments that Python itself needs for exceptional functionality. Mostly, the GUI code remains identical no the type of OS. 

Therefore, an advantage of PyQt in the face of wxPython is that it prevents most of the cross-platform issues you might encounter while coding. 

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

Another advantage of using <a href="https://pythonpyqt.com/">PyQt</a> might be the fact that the process goes smoothly no matter what type of operating system you have. You are also enabled to create your own script as part of the installation process, which we can say for sure it is a nice feature to have accessible. 

And PyQt is recommended mostly due to its flexibility that allows you to rearrange, float, close, or restore Qt panels at runtime. It is one of the most configurable usability-centric interfaces you will encounter.

## What to choose?

So, if you are wondering what to choose between PyQt and wxPython, we can tell you it is all about their toolkit’s strengths. 

wxPython is easy and intuitive, while it can be used with a GUI. Mostly, it is the best choice for those that have GTK installed, as it gets access to minima dependencies. 

On the other hand, PyQt represents a trustworthy foundational framework, commonly used due to the impressive amount of resources and user communities.

It arranges you entrance to a wide array of prebuilt characteristics, widgets, and abstractions, depending on the particularities of your project.

**Resources**
* <a href="https://gum.co/pysqtsamples">Course on PyQt Desktop Apps</a>
* <a href="https://pythonspot.com/wxpython-window/">wxPython tutorial</a>
* <a href="https://pythonbasics.org/pyqt-hello-world/">PyQt tutorial</a>