0

I am trying to use python files containing classes as some sort of config file. Thus i have multiple paths which lead to config.py files. I than want to load these files and thus gain access to the classes and the containing data. Is there a module which enables me to access the class in a given file, for example like this:

def get_config(path):
    # path = "....\config.py"     #containing a class <Options>
    file = load_class(path)     
    return file.Options

0 Answers0