Linked Questions
10 questions linked to/from subprocess.Popen.stdout - reading stdout in real-time (again)
1 vote
2 answers
233 views
How to process the ouput of POpen as a stream with struct.unpack? [duplicate]
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 ...
644 votes
33 answers
343k views
A non-blocking read on a subprocess.PIPE in Python
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 ...
122 votes
14 answers
189k views
catching stdout in realtime from subprocess
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 ...
47 votes
11 answers
15k views
How do I get 'real-time' information back from a subprocess.Popen in python (2.5)
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 ...
27 votes
6 answers
32k views
How can I read all availably data from subprocess.Popen.stdout (non blocking)?
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 ...
25 votes
2 answers
29k views
Intercepting stdout of a subprocess while it is running
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 ...
13 votes
1 answer
17k views
How to properly interact with a process using subprocess module
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. ...
6 votes
2 answers
10k views
Real-time intercepting of stdout from another process in Python
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: #!/...
3 votes
1 answer
3k views
Real time read from subprocess.stdout on Windows
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 ...
5 votes
2 answers
1k views
How can I call a command using Python, capturing stderr and stdout, without waiting for stderr/stdout to be closed?
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() ...