Top "Subprocess" questions

The Python subprocess module allows you to spawn new processes, connect to their input/output/error pipes, and obtain their return codes.

How to call an external command?

How do you call an external command (as if I'd typed it at the Unix shell or Windows command prompt) …

python shell terminal subprocess command
Running shell command and capturing the output

I want to write a function that will execute a shell command and return its output as a string, no …

python shell subprocess
Store output of subprocess.Popen call in a string

I'm trying to make a system call in Python and store the output to a string that I can manipulate …

python subprocess
Retrieving the output of subprocess.call()

How can I get the output of a process run using subprocess.call()? Passing a StringIO.StringIO object to stdout …

python pipe subprocess stringio
read subprocess stdout line by line

My python script uses subprocess to call a linux utility that is very noisy. I want to store all of …

python subprocess
How do I pass a string into subprocess.Popen (using the stdin argument)?

If I do the following: import subprocess from cStringIO import StringIO subprocess.Popen(['grep','f'],stdout=subprocess.PIPE,stdin=StringIO(…

python subprocess stdin
How to terminate a python subprocess launched with shell=True

I'm launching a subprocess with the following command: p = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True) However, when I …

python linux subprocess kill-process
How to use subprocess popen Python

Since os.popen is being replaced by subprocess.popen, I was wondering how would I convert os.popen('swfdump /tmp/…

python subprocess popen
Using module 'subprocess' with timeout

Here's the Python code to run an arbitrary command returning its stdout data, or raise an exception on non-zero exit …

python multithreading timeout subprocess
How to get exit code when using Python subprocess communicate method?

How do I retrieve the exit code when using Python's subprocess module and the communicate() method? Relevant code: import subprocess …

python subprocess