class MyWindow(QMainWindow):
def __init__(self):
super().__init__()
self.setWindowTitle("My Window")
self.setGeometry(400, 400, 400, 200)
btn1 = QPushButton("button1", self)
btn1.move(20, 20)
btn1.clicked.connect(self.btn1_clicked)
btn2 = QPushButton("button2", self)
btn2.move(20, 70)
btn2.clicked.connect(self.btn2_clicked)
def btn1_clicked(self):
btn1function
def btn2_clicked(self):
btn2function
Let's say I want to activate btn1function at 9AM, and btn2function at 10Am and automatically deactivate the function 5 minutes after the function has been activated. I tried putting loops that get broken at 9AM and after 5 minutes, but an error occured.
How can I do this?