def does_external_program_run(prog, verbose):
    """Test to see if the external programs can be run."""
    try:
        with open('/dev/null') as null:
            subprocess.call([prog, '-h'], stdout=null, stderr=null)
        result = True
    except OSError:
        if verbose > 1:
            print("couldn't run {}".format(prog))
        result = False

    return result
Test to see if the external programs can be run.