I am running another python background process within a python script and am trying to pipe its stdout to a file. I am running:
with open("log.log", "wb") as out:
p = subprocess.Popen(["python", "main.py"], stdout=out, bufsize=1)
However, the file is always empty while I can see in shell the output of the popen process just fine. Any idea?