def find_first_existing_executable(exe_list):
    """
    Accepts list of [('executable_file_path', 'options')],
    Returns first working executable_file_path
    """
    for filepath, opts in exe_list:
        try:
            proc = subprocess.Popen([filepath, opts],
                                    stdout=subprocess.PIPE,
                                    stderr=subprocess.PIPE)
            proc.communicate()
        except OSError:
            pass
        else:
            return filepath
def find_first_existing_executable(exe_list):
    """
    Accepts list of [('executable_file_path', 'options')],
    Returns first working executable_file_path
    """
    for filepath, opts in exe_list:
        try:
            proc = subprocess.Popen([filepath, opts],
                                    stdout=subprocess.PIPE,
                                    stderr=subprocess.PIPE)
            proc.communicate()
        except OSError:
            pass
        else:
            return filepath
def find_first_existing_executable ( exe_list ) : for filepath , opts in exe_list : try : proc = subprocess . Popen ( [ filepath , opts ] , stdout = subprocess . PIPE , stderr = subprocess . PIPE ) proc . communicate ( ) except OSError : pass else : return filepath
Accepts list of [('executable_file_path', 'options')],
    Returns first working executable_file_path
Accepts list of [ ( executable_file_path options ) ] Returns first working executable_file_path