Running Subprocess from Python
- by Rohit
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