How to reopen window

后端 未结 1 784
一整个雨季
一整个雨季 2021-01-26 03:28

The following code should close the current file and open it again. Instead, it keeps opening only new windows.

Does anybody have a hint for keeping the old window clos

相关标签:
1条回答
  • 2021-01-26 04:12

    You seem to have put self.close() in the wrong place. Also, you should not use subprocess.call, as it will block until the command completes. It's better to use QProcess instead:

        def run(self, path):
            QtCore.QProcess.startDetached('python', [path])
            self.close()
    
        def initUI(self):
            self.btn_newSearch = QtGui.QPushButton('Start', self)
            ...
    
    0 讨论(0)
提交回复
热议问题