<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def exec_file(path, name):
 """Extract a constant from a python file by looking for a line defining the constant and executing it."""

    result = {}
    code = read_file(path)
    lines = [line for line in code.split('\n') if line.startswith(name)]
    exec("\n".join(lines), result)
    return result[name]