class Config(dict): def __init__(self, fname): with open(fname) as f: data = f.read() exec(data, dict(), self)