class StreamWatcher: def stdout_watcher(self, identifier, stream): #for line in stream: for line in iter(stream.readline,b''): print line if not stream.closed: stream.close() print "-i- Thread Terminating : ", identifier,"\n" def stderr_watcher(self, identifier, stream): #for line in stream: for line in iter(stream.readline,b''): print (identifier, line) if not stream.closed: stream.close() print "-i- Thread Terminating : ", identifier, "\n" class something def somefunc #did stuff proc = subprocess.Popen([PathToCurrentPythonInterpreter, toolPath], stderr=subprocess.PIPE, stdout=subprocess.PIPE, env=env, bufsize=1) #create new stdout and stderr stream listener objects m=StreamWatcher() n=StreamWatcher() #create new threads for each listener, when the listener hears something it prints it to the GUI console log area Thread(target=m.stdout_watcher, name='stdout-watcher', args=('STDOUT', proc.stdout)).start() Thread(target=n.stderr_watcher, name='stderr-watcher', args=('STDERR', proc.stderr)).start()