python 2.7, qt 4.8.3, pyside 1.1.2
Trying to call a process without freezing the GUI.
Currently using subprocess.Popen
Code:
def setup_term(self):
self.txtProjLog.clear()
# select proj argument
cursor = self.txtProjects.textCursor()
projid = cursor.selectedText()
QApplication.setOverrideCursor(Qt.WaitCursor)
QApplication.processEvents()
# in case no proj selected
if projid == "":
QMessageBox.information(self, "Error", "No Project Selected")
return
command = ResDir + '/setproj.sh' + ' ' + projid
process = subprocess.Popen(command.split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
pilog = process.communicate()[0]
self.txtProjLog.append(pilog)
QApplication.restoreOverrideCursor()
The setproj.sh script will set environment variables and open an xterm but the python/pyside GUI is frozen until the xterm started by setproj.sh is closed.
If anyone can tell me how to make subprocess.POpen interactive then please let me know.
Cheers,