def which(program):
    # see http://stackoverflow.com/questions/377017/test-if-
    #  executable-exists-in-python

    def is_exe(fpath):
        return os.path.exists(fpath) and os.access(fpath, os.X_OK)

    fpath, fname = os.path.split(program)
    if fpath:
        if is_exe(program):
            return program
    else:
        for path in os.environ["PATH"].split(os.pathsep):
            exe_file = os.path.join(path, program)
            if is_exe(exe_file):
                return exe_file

    return None
Reads and saves selected output data variables into the database or a user-defined directory.
dataset/ETHPy150Open CGATOxford/cgat/CGAT/IOTools.py/which--crossover with--dataset/ETHPy150Open nasa/RHEAS/src/vic/vic.py/VIC.save