Linked Questions

1 vote
2 answers
233 views

Possible Duplicate: subprocess.Popen.stdout - reading stdout in real-time, again! I am processsing the ouptut of a file in binary but I am using a temporary string to represent the output. Since ...
BlueTrin's user avatar
  • 10.2k
644 votes
33 answers
343k views

I'm using the subprocess module to start a subprocess and connect to its output stream (standard output). I want to be able to execute non-blocking reads on its standard output. Is there a way to make ...
Mathieu Pagé's user avatar
122 votes
14 answers
189k views

I want to subprocess.Popen() rsync.exe in Windows, and print the stdout in Python. My code works, but it doesn't catch the progress until a file transfer is done! I want to print the progress for ...
John A's user avatar
  • 1,221
47 votes
11 answers
15k views

I'd like to use the subprocess module in the following way: create a new process that potentially takes a long time to execute. capture stdout (or stderr, or potentially both, either together or ...
Ryan's user avatar
  • 4,299
27 votes
6 answers
32k views

I need a way to either read all currently available characters in stream created by Popen or to find out how many characters are left in the buffer. Backround: I want to remote control an interactive ...
Perseids's user avatar
  • 13.3k
25 votes
2 answers
29k views

If this is my subprocess: import time, sys for i in range(200): sys.stdout.write( 'reading %i\n'%i ) time.sleep(.02) And this is the script controlling and modifying the output of the ...
Paul's user avatar
  • 43.9k
13 votes
1 answer
17k views

I'm having problems redirecting stdio of another program using subprocess module. Just reading from stdout results in hanging, and Popen.communicate() works but it closes pipes after reading/writing. ...
Ivan Baldin's user avatar
  • 3,499
6 votes
2 answers
10k views

I'd like to run a system process, intercept the output, and modify it real-time, line by line, in a Python script. My best attempt, which waits for the process to complete before printing, is: #!/...
Seth Johnson's user avatar
  • 15.3k
3 votes
1 answer
3k views

To emphasize, the problem is real time read instead of non-blocking read. It has been asked before, e.g. subprocess.Popen.stdout - reading stdout in real-time (again). But no satisfactory solution has ...
cqdjyy01234's user avatar
  • 1,180
5 votes
2 answers
1k views

Right now I have some code that uses Popen.communicate() from subprocess (setting stdin=PIPE and stderr=PIPE) to run a command and capture both stderr and stdout. The problem is that communicate() ...
Caleb Spare's user avatar