I'm working on a basic project with using PyQt5. I made a break method so I can close app with pressing a button. I made a loop in this but when I close the window loop doesn't go back. I want to able to close the window without quitting the program fully.
There is 'main' side:
        if __name__ == "__main__":
        app = QtWidgets.QApplication(sys.argv)
        mainWin = TextBar()
        mainWin.show()
        sys.exit(app.exec_())
And there is button and its command:
pybutton = QPushButton('OK', self)
            pybutton.clicked.connect(self.clickMethod)
            pybutton.resize(200, 32)
            pybutton.move(80, 100)
        def clickMethod(self):
            print('Name: ' + self.tool.text(), '\nProperties:' + self.prop.text(), '\n')
            TextBar.close(self)
I want to close ONLY window when I press OK, NOT full of program.
 
    