Running Subprocess from Python

Posted by Rohit on Stack Overflow See other posts from Stack Overflow or by Rohit
Published on 2013-06-25T21:05:57Z Indexed on 2013/06/25 22:21 UTC
Read the original article Hit count: 213

Filed under:
|
|

I want to run a cmd exe using a python script.

I have the following code:

def run_command(command):
    p = subprocess.Popen(command, shell=True,
            stdout=subprocess.PIPE,
            stderr=subprocess.STDOUT)
    return p.communicate()

then i use: run_command(r"C:\Users\user\Desktop\application\uploader.exe") this returns the option menu where i need to specify additional parameter for the cmd exe to run. So i pass additional parameters for the cmd exe to run. How do i accomplish this. I've looked at subprocess.communicate but i was unable to understand it

© Stack Overflow or respective owner

Related posts about python

Related posts about subprocess