Hello,
I'm new to Qt and I'm trying to redirect the stdout/stderr from a python script to a TextBroswer window. The problem I'm having is that it seem like the readyReadStandardOutput singal only emits after subprocess completes. I would like it to emit whenever there is new data so it looks like it updated in real-time as the script runs.
here's some code snipets:
def runScript(self):
process = QProcess()
self.RunningProcess = process
self.RunningProcess.setProcessChannelMode(QProcess .MergedChannels)
self.RunningProcess.closeWriteChannel()
command = "C:\\Python25\\python.exe TestOptparse.py"
self.connect(self.RunningProcess, SIGNAL("readyReadStandardOutput()"), self.readOutput)
self.connect(self.RunningProcess, SIGNAL("readyReadStandardError()"), self.readOutput)
self.RunningProcess.start(command)
def readOutput(self):
string = ""
bytearray = self.RunningProcess.readAllStandardOutput()
if not bytearray.isEmpty():
string = str(QString(bytearray))
self.LoggerWidget.append(string)
Please help!!
Francis
Bookmarks