title: python curl execute command with parameter
body: <p>I need to execute the following command </p>
  
  <pre><code>curl -v -H 'X-Auth-User: myaccount:me' -H 'X-Auth-Key: secretpassword' http://localhost:8080/auth/v1.0/
  </code></pre>
  
  <p>when I run this from terminal it works perfectly. and gives me result like following</p>
  
  <pre><code>* About to connect() to localhost port 8080 (#0)
  *   Trying ::1...
  * Connection refused
  *   Trying 127.0.0.1...
  * Connected to localhost (127.0.0.1) port 8080 (#0)
  &gt; GET /auth/v1.0/ HTTP/1.1
  &gt; User-Agent: curl/7.29.0
  &gt; Host: localhost:8080
  &gt; Accept: */*
  &gt; X-Auth-User: myaccount:me
  &gt; X-Auth-Key: secretpassword
  &gt; 
  &lt; HTTP/1.1 200 OK
  &lt; X-Storage-Url: http://localhost:8080/v1/AUTH_myaccount
  &lt; X-Auth-Token: AUTH_tk8bf07349d36041339450f0b46a2adc39
  &lt; Content-Type: text/html; charset=UTF-8
  &lt; X-Storage-Token: AUTH_tk8bf07349d36041339450f0b46a2adc39
  &lt; Content-Length: 0
  &lt; X-Trans-Id: tx99a9e2a129f34ab487ace-00553cb059
  &lt; Date: Sun, 26 Apr 2015 09:31:05 GMT
  &lt; 
  * Connection #0 to host localhost left intact
  </code></pre>
  
  <p>But i need to run this from python. I have used subprocess.call and subprocess.popen in the following way</p>
  
  <pre><code>import subprocess
  subprocess.call(["curl", "-v -H 'X-Auth-User: myaccount:me' -H 'X-Auth-Key: secretpassword' http://localhost:8080/auth/v1.0/"], shell=False)
  </code></pre>
  
  <p>but I am getting the followin error</p>
  
  <pre><code>curl: option -v -H 'X-Auth-User: myaccount:me' -H 'X-Auth-Key: secretpassword' http://localhost:8080/auth/v1.0/: is unknown
  curl: try 'curl --help' or 'curl --manual' for more information
  </code></pre>
  
  <p>using popen</p>
  
  <pre><code>result = subprocess.Popen(["curl", "-v -H 'X-Auth-User: myaccount:me' -H 'X-Auth-Key: secretpassword' http://localhost:8080/auth/v1.0/"])
  print(result)
  </code></pre>
  
  <p>and getting error for this </p>
  
  <pre><code>curl: option -v -H 'X-Auth-User: myaccount:me' -H 'X-Auth-Key: secretpassword' http://localhost:8080/auth/v1.0/: is unknown
  curl: try 'curl --help' or 'curl --manual' for more information
  &lt;subprocess.Popen object at 0x7fd003d82cd0&gt;
  </code></pre>
  
  <p>How to fix this???</p>