#! /usr/bin/python
#Datei: handleButton.py

import sys
from PyQt6.QtWidgets import QApplication, QMainWindow, QPushButton


class MainWindow(QMainWindow):
    def __init__(self):
        super().__init__()

        self.setWindowTitle("Button  Signal")

        button = QPushButton("Bitte klicken")
        button.setCheckable(True)
        button.clicked.connect(self.handle_button_click)

        # Set the central widget of the Window.
        self.setCentralWidget(button)

    def handle_button_click(self):
        print("Button geklickt")


app = QApplication(sys.argv)

window = MainWindow()
window.show()

app.exec()