I am writing a Python 2.7 app that relies on several rpm packages to be installed. There is a planned port to Python 3 in the near future. Is there a simple function call to check if an rpm is installed that works in both versions of Python?
e.g.
rpm = "binutils"
if package_installed(rpm):
print("{} is installed".format(rpm))