Without more context, it's harder to give more help than that. It might also help to answer the following questions: What are you trying to do? Why do you think you need python to do this? What criteria do you want to base the python code gen on? Is the code intended for use in your app? If so, I would suggest reading this: https://twistedmatrix.com/users/glyph/rant/extendit.html
Thats fine I am happy you are trying to help me 😊
There is no real configuration file, what I need is a dynamic way to generate python function from given values parsed before.
Do you want to convert C++ code to the equivalent Python code? I don't think you will find an automatic way to do this. You probably will have to convert it yourself. To do this you need a good knowledge of both C++ and Python.
Do you want a program written in C++ to output Python code? In that case you just make the program output the python code that you want to output like nchambers showed. If you don't want to output all Python code at the same time you can split it up and use cout multiple times in your code. If you want to write the output to a file rather than the standard output stream you could use a std::ofstream instead of std::cout, but you don't have to because std::cout can be redirected to write to a file so it's up to you what you find most convenient.