title: Check if a Debian package is installed from Python
body: <p>Is there an elegant and more Python-like way to check if a package is installed on Debian?</p>
  
  <p>In a bash script, I'd do:</p>
  
  <pre><code>dpkg -s packagename | grep Status
  </code></pre>
  
  <p>Suggestions to do the same in a Python script?</p>