Installing the PySide library
To create a desktop application, you must build it with a GUI library. There are a lot of GUI libraries and some Python GUI libraries. For this application, you’re going to use the PySide library. You can install PySide using pip:
(.venv) $ pip install pyside6
To test the library, you can write a simple GUI application. Let’s create a script named hello_pyside.py and add the following code to it:
import sys
from PySide6 import QtCore, QtWidgets
class TextWidget(QtWidgets.QWidget):
def __init__(self):
super().__init__()
self.label = QtWidgets.QLabel("Hello Pyside")
self.button = QtWidgets.QPushButton("Button")
self.layout = QtWidgets.QVBoxLayout(self)
self...