You can catch the error:
try:
call('/usr/sbin/snif')
except OSError:
print "It didn't execute"
If you want to see if the command executed correctly, use check_output
or check_call
instead and catch another error:
import subprocess:
try:
subprocess.check_output('/usr/sbin/snif')
except OSError:
print 'That file does not exist'
except subprocess.CalledProcessError:
print 'Bad exit code'