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
If you are checking for the existence of a package that installs a Python module, you can test for this from within a dependent Python script - try to import it and see if you get an exception:
import sys
try:
import maybe
except ImportError:
print "Sorry, must install the maybe package to run this program."
sys.exit(1)