def which(program):
if os.path.split(program)[<NUM_LIT:0>]:<EOL><INDENT>program_path = find_exe(program)<EOL>if program_path:<EOL><INDENT>return program_path<EOL><DEDENT><DEDENT>else:<EOL><INDENT>for path in get_path_list():<EOL><INDENT>program_path = find_exe(os.path.join(path, program))<EOL>if program_path:<EOL><INDENT>return program_path<EOL><DEDENT><DEDENT><DEDENT>return None<EOL>
Identify the location of an executable file.