Now that you've learned about Qt5 and PyQt5, it's time to dig in and do some coding. Make sure everything is installed, open your favorite Python editor or IDE, and let's begin!
Create a hello_world.py file in your editor, and enter the following:
from PyQt5 import QtWidgets
We begin by importing the QtWidgets module. This module contains the bulk of the widget classes in Qt, as well as some other important components for GUI creation. We won't need QtGui or QtCore for such a simple application.
Next, we need to create a QApplication object, like this:
app = QtWidgets.QApplication([])
The QApplication object represents the state of our running application, and one must be created before any other Qt widgets can be created. QApplication is supposed to be passed a list of command-line arguments given to our script,...