Linked Questions
10 questions linked to/from real time subprocess.Popen via stdout and PIPE
99 votes
7 answers
111k views
Read streaming input from subprocess.communicate() [duplicate]
I'm using Python's subprocess.communicate() to read stdout from a process that runs for about a minute. How can I print out each line of that process's stdout in a streaming fashion, so that I can ...
32 votes
4 answers
46k views
Python subprocess readlines() hangs
The task I try to accomplish is to stream a ruby file and print out the output. (NOTE: I don't want to print out everything at once) main.py from subprocess import Popen, PIPE, STDOUT import pty ...
6 votes
3 answers
5k views
Bash pipe to python
I need to absorb output of a bash command via pipe in real time. E.g for i in $(seq 1 4); do echo $i; sleep 1; done | ./script.py Where script.py has this for line in sys.stdin.readlines(): ...
4 votes
3 answers
16k views
Python PIPE to popen stdin
I am attempting something very similar to real time subprocess.Popen via stdout and PIPE I, however, want to send input to the running process as well. If I start a process in a separate thread ...
1 vote
0 answers
3k views
Receiving streaming output from ssh connection in Python
I am running a script remotely on a server via SSH and Python. This script looks through log files and returns some information based on each log entry it encounters. The problem I am running into is ...
0 votes
1 answer
892 views
call external program in python, watch output for specific text then take action
i'm looking for a way in python to run an external binary and watch it's output for: "up to date" If "up to date" isn't returned i want to run the original command again, once "up to date" is ...
1 vote
2 answers
1k views
How do I read Fortran output into Python?
I inherited some code that looks like this: Python -> File -> Modern Fortran -> File -> Python where each File contains a simple array of reals. I now need to run this program many times ...
0 votes
1 answer
495 views
Start scripts in POpen subprocesses and get their output continously
Hi I have spent a few days reading at stackoverflow for an answer why I get the output listed below instead of seeing the loop in hello.py count forever. Still unclear for me and nothing works. How to ...
1 vote
0 answers
525 views
How to call scripts from python and have their output printed in real time
I'm writing a program for Windows 7 using Python 2.7.9. This program allows the user to schedule and run a list of scripts and needs to show the output of the scripts in real-time. In order to run the ...
-1 votes
2 answers
391 views
Run a process in python, writing the process output to stdout? [duplicate]
I want to run a process from a python script, blocking while it runs, and writing the output of the process to stdout. How would I do this? I looked at the documentation for 'subprocess' but couldn'...