title: How to retrieve information from curl using python subprocess
body: <p>I'm using curl.exe on windows. But unfortunately I can't get back data from console.</p>
  
  <p>python code looks like this:</p>
  
  <pre><code>tid = subprocess.Popen("C:/users/zero/Desktop/lm/curl.exe -i -H \"Cookie: login=" + userhash + "\" -F \"type=" + caid + "\" -F \"description=\" -F \"descr=" + cleaned + "\" -F \"filetype=2\" -F \"name=" + pavadinimas + "\" -F \"file=@" + namel + "\" -F \"tag=@" + nto + "\" http://www.isos.lt/upload.php")
  </code></pre>
  
  <p>I tried with process.returncode to retrieve the information, but I don't get correct info.
  I can see that info in cmd but I don't know how to get it. Maybe it's possible to get that info with stdout=subprocess.PIPE, process.communicate()?</p>
  
  <p>EDIT: </p>
  
  <p>This command posted by sukhbir  helped. Thanks.</p>
  
  <pre><code>p = subprocess.Popen(command, stdout=subprocess.PIPE).communicate()[0]
  
  Where command is your command.
  </code></pre>