I have issue where i want to create Dynamic function which will do some calculation based to values retrieved from database, i am clear with my internal calculation but ques
You can use the type function to create a python class dynamically or a metaclass. Ill describe the first method:
myDynamicClassWithDynamicFunctions = type('ClassName', (object,), {
'phase1': aFunction,
'phase2': anotherFunction,
....})
The arguments to type are: the class name, the class bases (as a tuple), the class attributes in a dict. Of course, you can construct these parameters programmatically as you wish.