def type_printed(pth, rpm_dirs=False):
    if not os.path.exists(pth):
        print(pth + ' -- does not exist')
return True
FNULL = open(os.devnull, 'w')
if rpm_dirs or not os.path.isdir(pth):
    rc = subprocess.call(['rpm', '-qf', pth], stdout=FNULL, stderr=
        subprocess.STDOUT)
if rc == 0:
    pass
pip freeze: show only packages installed via pip