I want to create a list of all functions in .py file and then use these functions randomly. I've already created some list using dir(), but cannot run.
file with functions file.py:
def f1:
# some code
def f2:
# some code
def f3:
# some code
another script:
functions = dir(file)
random.choice(functions)()
It shows this error
TypeError: 'str' object is not callable