Home>
import sys
from PyQt5.QtWidgets import *
from PyQt5 import QtCore, QtWidgets
from PyQt5.QtCore import QSize
import time
class MainWindow(QMainWindow):
    def __init__(self):
        QMainWindow.__init__(self)
        self.btn1= QPushButton("Button 2", self)
        self.btn1.move(100, 200)
        self.btn1.clicked.connect(self.ss)
        self.btn2= QPushButton("Button 1", self)
        self.btn2.move(190, 200)
        self.btn2.clicked.connect(self.s)
        self.run= True
    def ss(self):
        self.run= False
        time.sleep(10)
    defs(self):
        for i in range(0,10):
            if self.run== False:
                print('123213')
            time.sleep(1)
            print(i)
if __name__== "__main__":
    import sys
    app= QtWidgets.QApplication([])
    app.setStyle('Breeze')
    mw= MainWindow()
    mw.show()
    sys.exit(app.exec())