I'm writing a plugin for QGIS and inside the method def run(self), after the OK button of the plugin is clicked, i.e., inside
# Run the dialog event loop result = self.dlg.exec_() # See if OK was pressed if result == 1: . .
I have a test about some variables. If the test fails, I write a message using
Then I would like to run again the plugin. I tried to execute the code
after the QMessageBox, but the behavior is quite strange, because sometimes the same QMessageBox appears again and again. So, how could I run again the plugin?