(commands, command_args, *args, **kwargs)
Like `subprocess.Popen`, but can try multiple commands in case
    some are not available.

    `commands` is an iterable of command names and `command_args` are
    the rest of the arguments that, when appended to the command name,
    make up the full first argument to `subprocess.Popen`. The
    other positional and keyword arguments are passed through.
Like `subprocess.Popen`, but can try multiple commands in case
    some are not available.
Like subprocess . Popen but can try multiple commands in case some are not available .
def popen_multiple(commands, command_args, *args, **kwargs):
    """Like `subprocess.Popen`, but can try multiple commands in case
    some are not available.

    `commands` is an iterable of command names and `command_args` are
    the rest of the arguments that, when appended to the command name,
    make up the full first argument to `subprocess.Popen`. The
    other positional and keyword arguments are passed through.
    """
    for i, command in enumerate(commands):
        cmd = [command] + command_args
        try:
            return subprocess.Popen(cmd, *args, **kwargs)
        except OSError:
            if i == len(commands) - 1:
                # No more commands to try.
                raise
def popen_multiple ( commands , command_args , * args , * * kwargs ) : for i , command in enumerate ( commands ) : cmd = [ command ] + command_args try : return subprocess . Popen ( cmd , * args , * * kwargs ) except OSError : if i == len ( commands ) - 1 : # No more commands to try. raise