[Tutor] How to get messages from stderr
klappnase
klappnase@freenet.de
Wed Jul 30 20:13:02 2003
Hello everyone,
I try to get progress messages from a shell command on the fly while the process is still running
for use in a progress window. The problem is that most of these messages are printed to stderr.
Now I tried something like:
def runcmd(self):
self.pp = popen2.Popen4(cmd)
self.ppp = self.pp.fromchild
self.frame.after(100, self.getprogress)
def getprogress(self):
self.progress = self.ppp.read()
self.frame.after(100, self.getprogress)
but I found that I only got any output after the child process had finished.
It seems to work as long as I only get the output from stdout with Popen3, but I need the stderr messages.
Does anyone know a way to get the output from stderr while the child process is still running?
Any help would be very appreciated.
Thanks
Michael