there is the following code

def loadEngine(self): filename=QtGui.QFileDialog.getOpenFileName(self, "Open File","","*.exe") #if self.process.state()==QtCore.QProcess.Running: self.process.kill() self.process.start(str(filename)) 

The problem is this: if self.process is already running and I want to start another process by selecting the appropriate file, then the new process will not start. As I understand it, this is due to the fact that the old process is not killed. Question: why is he not killed? Help me please.

    1 answer 1

    all you need to add self.process.waitForFinished() after self.process.kill()

    • It is not the answer to the question. To leave your comments or ask the author to clarify, leave a comment to the appropriate post. - From the queue of checks - rjhdby
    • @rjhdby, he seemed to answer his question and answered: D - gil9red