MRTestRepo/PepProTools/putilities.py

18 lines
401 B
Python
Executable File

#!/usr/bin/env python3
import apt
#this script is for performing utility functions
#gets all installed packages
cache = apt.Cache()
#Checks if a package is installed
def installcheck(appname):
try:
print(appname,cache[appname].is_installed)
return cache[appname].is_installed
except:
#probably not installed or otherwise throws errors on check
return False