I am using Popen
to start a background process and I am writing the stdout and stderr to a file:
with open("log.log", "w+", buffering=1) as out:
p = subprocess.Popen(["run", "cmd"], stdout=out, stderr=out, bufsize=1)
Is it possible to also display stdout and stderr in shell (i.e., on screen)?
I am aware that I could use a PIPE
for it, but then my code would block for execution of Popen
.