There is a variable name in which the text is written, for example "n", how to call a variable whose name is the text in the variable name?
eval(...)
def some_func(): print('hello') name = 'some_func' globals()[name]()
Source: https://ru.stackoverflow.com/questions/881470/More articles:How to change the corners of the button in AndroidC ++ friend function and namespaceUsing global in PythonHow to pass class method to addEventListener in JS 2015 constructor?A * cannot bypass an obstacle (JS)JSON for TreeTable in PRIME NGPeewee ORM. Generating a request to insert a record with a variable number of fieldsHow to make the text does not adjust to the block sizeProblems using SCORM coursesException when trying to get Connection from ConnectionPoolAll Articles
eval(...)- avp