Reputation: 81
Suppose, I'm building an application where shell commands gonna execute. How to check that the command I'm using is available or not?
Upvotes: 1
Views: 337
Reputation: 419
You can use subprocess module to execute shell commands
import subprocess
output = subprocess.check_output(command, shell=True).decode("ascii")
How do I check if a package is installed
Upvotes: 1