Linked Questions

99 votes
7 answers
111k views

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 ...
Heinrich Schmetterling's user avatar
32 votes
4 answers
46k views

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 ...
vermin's user avatar
  • 1,099
6 votes
3 answers
5k views

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(): ...
Sridhar Iyer's user avatar
  • 2,850
4 votes
3 answers
16k views

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 ...
Mr S's user avatar
  • 578
1 vote
0 answers
3k views

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 ...
xlnc's user avatar
  • 47
0 votes
1 answer
892 views

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 ...
bleomycin's user avatar
1 vote
2 answers
1k views

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 ...
astromonerd's user avatar
0 votes
1 answer
495 views

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 ...
Rimfire's user avatar
  • 400
1 vote
0 answers
525 views

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 ...
The CodeWriter's user avatar
-1 votes
2 answers
391 views

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'...
mackenir's user avatar
  • 11k