Execute curl command within Python
<p>I am a beginner with python. I am trying to execute a curl command within Python script.</p>

<p>If I do it in the terminal, it looks like this:</p>

<pre><code>curl -k -H "Authorization: Bearer xxxxxxxxxxxxxxxx" -H "hawkular-tenant: test" -X GET https://www.example.com/test | python -m json.tool
</code></pre>

<p>I tried to do research, so I think I can use urllib2 library.</p>

<p>How can I run this command?</p>