how can I parse json with a single line python command?
<p>I would like to use python to parse JSON in batch scripts, for example:</p>
<pre><code>HOSTNAME=$(curl -s &quot;$HOST&quot; | python ?)
</code></pre>
<p>Where the JSON output from curl looks like:</p>
<pre><code>'{&quot;hostname&quot;:&quot;test&quot;,&quot;domainname&quot;:&quot;example.com&quot;}'
</code></pre>
<p>How can I do this with a single line python command?</p>