def find_file_in_path(to_find, path_str, pathsep=None, reverse=True):
if pathsep is None:<EOL><INDENT>pathsep = os.pathsep<EOL><DEDENT>paths = path_str.split(pathsep)<EOL>if reverse:<EOL><INDENT>paths = reversed(paths)<EOL><DEDENT>for path in paths:<EOL><INDENT>test_path = os.path.join(path, to_find)<EOL>if os.path.isfile(test_path):<EOL><INDENT>return test_path<EOL><DEDENT><DEDENT>return None<EOL>
Attempts to find the given relative path to_find in the given path