title: return http error code for curl in python
body: <pre><code>status, output = commands.getstatusoutput("curl -k -v --cookie cookie_name 'URL' -o filename")
  </code></pre>
  
  <p>Above is my code , I am trying to return http response code of curl. So i tried the following option -w %{http_code}</p>
  
  <pre><code>status, output = commands.getstatusoutput("curl -k -v --cookie cookie_name -w %{http_code} 'URL' -o filename")
  </code></pre>
  
  <p>When i run it in python script and print status, nothing gets printed. 
  Can someone please help me with the curl return code?
  I want to try scenario's like when username password is wrong to get a status, or when the network host is not reachable or content not downloaded properly.</p>