app = QApplication(sys.argv)

window = QWidget() window.setWindowTitle("Widgets Demo") window.resize(300, 200)

layout = QGridLayout() layout.addWidget(QLabel("Name:"), 0, 0) layout.addWidget(QLineEdit(), 0, 1) layout.addWidget(QLabel("Email:"), 1, 0) layout.addWidget(QLineEdit(), 1, 1) Override built-in event handlers or connect signals.

pip install PyQt6 Verify the installation:

Introduction PyQt6 is a set of Python bindings for Qt6, one of the most powerful frameworks for building graphical user interfaces (GUIs). With PyQt6, you can create professional desktop applications that run on Windows, macOS, and Linux — all using Python.

sys.exit(app.exec())