title: Python executing commands in the command prompt (taskkill)
body: <p>I'm trying to use <code>os.system</code> to use the taskkill command in command prompt. ill gut out the only part im having trouble with:</p>
  
  <pre><code>os.system('taskkill /s %s /u CORP\Administrator /p CLARiiON! /pid AxAuto.exe'%(connection[i]))
  </code></pre>
  
  <p>The variable <code>connection[i]</code> is just an IP Address of a remote computer on the same network. I can run this command straight from the command prompt locally and just directly input the IP and I know for a fact it will work, But running the command through Python in this format returns "> was unexpected at this time." Am I making a silly formatting mistake in this line of code? the error can be seen below:
  <img src="https://i.stack.imgur.com/dvRcy.png" alt="&quot;&gt; was unexpected at this time."></p>
  
  <p><br> <strong>EDIT:</strong> I've also been told to use the Subprocess module. i tried the snippet below:<br></p>
  
  <pre><code>command="taskkill /s %s /u CORP\Administrator /p CLARiiON! /im AxAuto.exe"%(connection[i]))
  subprocess.Popen(command, stdout= subprocess.PIPE, stdin = subprocess.PIPE, stderr=subprocess.PIPE)
  </code></pre>
  
  <p>It doesnt fail in the script but it also doesnt kill the process.</p>