A template for a python function


This Content is from Stack Overflow. Question asked by Rishab Gupta

Is it possible to create a python function based on user inputs using a template (using jinja or any other templating engine)?

user will pass the function name:


def { function_name }(params):

For now, I just need the function name from the user and have a function defined using it. The functionality is pre-defined.


Check the Answers

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?