Lets examine these two Python modules for making GUIs (Graphical User Interfaces).
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.
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?
This article aims to answer all of these questions, by breaking them into different categories for the purpose of comparison:
The overall aesthetics might not seem important, but it is the first thing a person notices when the application is turned on.
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.
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.
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.
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.
While wxPython does have some designers (wxGlade, boa-constructor), they are nowhere near as user friendly and usable (in my opinion).
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.