Alle Dateien aus dem Pythonkurs
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

30 lines
627 B

#! /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()