def _iscommand(cmd):
 if _isexecutable(cmd):
  return True
 path = os.environ.get('PATH')
 if (not path):
  return False
 for d in path.split(os.pathsep):
  exe = os.path.join(d, cmd)
  if _isexecutable(exe):
   return True
 return False

def _iscommand ( cmd ) : if _isexecutable ( cmd ) : return True path = os . environ . get ( 'PATH' ) if ( not path ) : return False for d in path . split ( os . pathsep ) : exe = os . path . join ( d , cmd ) if _isexecutable ( exe ) : return True return False
return true if cmd is executable or can be found on the executable search path .