I have a program that I wrote that is creating and maintaining an array and I have another module that I wrote that has functions to manipulate the array. Is it possible to call every function in the imported module without having to hard code every function call? Meaning something like this:
#Some way I don't know of to get a list of function objects
listOfFunctions = module.getAllFunctions()
for function in listOfFunctions:
array.function()
I want to do this so I don't have to update my main file every time I add a function to my manipulation module.
I found these:
How to call a function from every module in a directory in Python?
Is it possible to list all functions in a module?
listing all functions in a python module
and also only found listing the functions in a module on the python docs.
I can think of a way to do this using some string manipulation and the eval()
function but I feel like there has to be a better, more pythonic way