Uses the shell program "which" to determine whether the named program
    is available on the shell PATH.

def check_program(name):
    """
    Uses the shell program "which" to determine whether the named program
    is available on the shell PATH.
    
    """
    with open(os.devnull, "w") as null:
        try:
            subprocess.check_call(("which", name), stdout=null, stderr=null)
        except subprocess.CalledProcessError as e:
            return False
    return True