import sys sys.path.insert(0, '..') class Config(dict): def __init__(self, fname): with open(fname) as f: data = f.read() exec(data, dict(), self)