Last active
July 3, 2018 20:24
-
-
Save umiphos/6799416f62625acbef078eb15c2039f2 to your computer and use it in GitHub Desktop.
Check if a pgk is installed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""If installed it will return 0""" | |
os.system('which your app') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
retval = subprocess.call(["which", "packagename"]) | |
if retval != 0: | |
print("Packagename not installed!") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment