Is there an elegant and more Python-like way to check if a package is installed on Debian?
In a bash script, I\'d do:
dpkg -s packagename | grep Stat
This is a pythonic way:
import apt cache = apt.Cache() if cache['package-name'].is_installed: print "YES it's installed" else: print "NO it's NOT installed"