def exec_file(path):
    """ Execute a text file that defines a Python dict.

    Parameters
    ----------
    path: str
        the path to a text file containing a Python dict.

    Returns
    -------
    exec_dict: dict
        the file content as a Python dictionary.
    """
    exec_dict = {}
    with open(path, 'r') as open_file:
        exec(open_file.read(), exec_dict)
    return exec_dict
