loading a piece of python code as a variable in config parser

23 Views Asked by At

I'm using a config parser to load variables:

config = configparser.ConfigParser()
config.optionxform = str
config.read(file_parameters)

and one of them is a piece of source code to be executed by calling function exec()

The trouble is that multiline variables do not keep the indentation required by the Python code. Does anyone know how to load multiple variables and keep the changing indentation? regards

0

There are 0 best solutions below