I need to write a script that reads a certain module (not as an import) and yields a list of its function names.
Something like that:
# script_to_be_listed.py
def function1():
pass
def function2():
pass
Where this:
python my_reader_script.py script_to_be_listed.py
Should print this:
function1
function2
I have already tried using inspect and dir but it only works if I import the module (which I don't know exactly what will be given).
If there is no native module to help me out on such task, could you guys suggest me a nice way to do so?
OBS: I'm doing this to automatically create some Lambda functions on AWS and naming them as the functions from script_to_be_listed.py.