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.

Is it possible to run function in a subprocess without threading or writing a separate file/script.

import subprocess def my_function(x): return x + 100 output = subprocess.Popen(my_function, 1) #I would like to pass the function …

python function subprocess popen python-multiprocessing
How to run external executable using Python?

I have an external executable file which i am trying to run from a Python script. CMD executable runs but …

python subprocess executable
Saving stdout from subprocess.Popen to file, plus writing more stuff to the file

I'm writing a python script that uses subprocess.Popen to execute two programs (from compiled C code) which each produce …

python linux subprocess stdout python-2.4
subprocess.check_output return code

I am using: grepOut = subprocess.check_output("grep " + search + " tmp", shell=True) To run a terminal command, I know that …

python subprocess
Read streaming input from subprocess.communicate()

I'm using Python's subprocess.communicate() to read stdout from a process that runs for about a minute. How can I …

python subprocess
Opening a process with Popen and getting the PID

I'm working on a nifty little function: def startProcess(name, path): """ Starts a process in the background and writes a …

python subprocess popen
Why does Popen.communicate() return b'hi\n' instead of 'hi'?

Can someone explain why the result I want, "hi", is preceded with a letter 'b' and followed with a newline? …

python subprocess popen
Python: subprocess and running a bash script with multiple arguments

How do I go about running a bash script using the subprocess module, to which I must give several arguments? …

python bash arguments subprocess popen
gzip a file in Python

I want to gzip a file in Python. I am trying to use the subprocss.check_call(), but it keeps …

python gzip subprocess