def find_in_path(command_name):
    "Search user's PATH for a given executable.\n\n  Returns:\n    Full path to executable.\n  "
    extensions = ('',)
    if ((not os.path.splitext(command_name)[1]) and (os.name == 'nt')):
        extensions = ('.bat', '.com', '.exe')
    for path in os.environ.get('PATH', '').split(os.pathsep):
        for ext in extensions:
            full_name = os.path.join(path, (command_name + ext))
            if (os.path.exists(full_name) and os.path.isfile(full_name)):
                return full_name
    raise error.Error(('command not found: %s' % command_name))
Search user's PATH for a given executable.

Returns:
  Full path to executable.
def find_in_path(command_name):
    "Search user's PATH for a given executable.\n\n  Returns:\n    Full path to executable.\n  "
    extensions = (,)
    if ((not os.path.splitext(command_name)[1]) and (os.name == 'nt')):
        extensions = ('.bat', '.com', '.exe')
    for path in os.environ.get('PATH', ).split(os.pathsep):
        for ext in extensions:
            full_name = os.path.join(path, (command_name + ext))
            if (os.path.exists(full_name) and os.path.isfile(full_name)):
                return full_name
    raise error.Error(('command not found: %s' % command_name))