I would like to load a .py file at runtime. This .py file is basically a config file of the following format:
var1=value
Once this file is loaded, I would like to be able to access var1, var2 and predicate_function. For each line, I'll pass it to the predicate func, if it returns false, I'll ignore it.
var2=value
predicate_function=func line :
In any case, I'm not sure how to load a python file at runtime and access its variables.
Clarification edit: There may be any number of these config files I need to pass to the main program and I won't know their names until runtime. Google tells me I should use "_ _ import _ _," (without spaces between underscores). I'm not sure how to correctly use that method and then access the variables of the imported file.