Python subprocess get children’s output to file and terminal?
The call() function is just Popen(*args, **kwargs).wait(). You could call Popen directly and use stdout=PIPE argument to read from p.stdout: #!/usr/bin/env python import sys from subprocess import Popen, PIPE from threading import Thread def tee(infile, *files): “””Print `infile` to `files` in a separate thread.””” def fanout(infile, *files): with infile: for line in iter(infile.readline, b””): for … Read more