![Run a subprocess in python and both show the output in "real time" and save it to a variable - Stack Overflow Run a subprocess in python and both show the output in "real time" and save it to a variable - Stack Overflow](https://i.stack.imgur.com/YS2am.jpg)
Run a subprocess in python and both show the output in "real time" and save it to a variable - Stack Overflow
BUG: Can't run subprocess.Popen(..., stdout=sys.stdout) in IPython window · Issue #272 · ipython/ipykernel · GitHub
![sophie alpert on Twitter: "python people: why might subprocess.Popen('wc -l', stdin=subprocess.PIPE, shell=True) sporadically throw "OSError: [Errno 9] Bad file descriptor"? Only happens sometimes. Google has been no help. (Most other people seem sophie alpert on Twitter: "python people: why might subprocess.Popen('wc -l', stdin=subprocess.PIPE, shell=True) sporadically throw "OSError: [Errno 9] Bad file descriptor"? Only happens sometimes. Google has been no help. (Most other people seem](https://pbs.twimg.com/media/EKFa_hQXYAMyU4d.jpg)
sophie alpert on Twitter: "python people: why might subprocess.Popen('wc -l', stdin=subprocess.PIPE, shell=True) sporadically throw "OSError: [Errno 9] Bad file descriptor"? Only happens sometimes. Google has been no help. (Most other people seem
![Mike Driscoll on Twitter: "#Python's `subprocess` module also lets you read stdout and stderr during a long running process. One common method of accomplishing this is to use `subprocess.Popen` and set `stdout=subprocess .PIPE` Mike Driscoll on Twitter: "#Python's `subprocess` module also lets you read stdout and stderr during a long running process. One common method of accomplishing this is to use `subprocess.Popen` and set `stdout=subprocess .PIPE`](https://pbs.twimg.com/media/FW1FOXCXoAIrS_c.jpg)
Mike Driscoll on Twitter: "#Python's `subprocess` module also lets you read stdout and stderr during a long running process. One common method of accomplishing this is to use `subprocess.Popen` and set `stdout=subprocess .PIPE`
![Console breaks subprocesses stdout/stderr PIPE if script finishes before the subprocess · Issue #118 · spyder-ide/spyder-kernels · GitHub Console breaks subprocesses stdout/stderr PIPE if script finishes before the subprocess · Issue #118 · spyder-ide/spyder-kernels · GitHub](https://user-images.githubusercontent.com/14357794/60247705-7c8c5000-9904-11e9-8f7d-04c7fc5ed1f8.png)