def _FindCommandInPath(command):
 if (('/' in command) or ('\\' in command)):
  return command
 else:
  paths = os.environ.get('PATH', '').split(os.pathsep)
  for path in paths:
   item = os.path.join(path, command)
   if (os.path.isfile(item) and os.access(item, os.X_OK)):
    return item
 return command

def _FindCommandInPath ( command ) : if ( ( '/' in command ) or ( '\\' in command ) ) : return command else : paths = os . environ . get ( 'PATH' , '' ) . split ( os . pathsep ) for path in paths : item = os . path . join ( path , command ) if ( os . path . isfile ( item ) and os . access ( item , os . X_OK ) ) : return item return command
if there are no slashes in the command given .