import inspect
import sys

def test():
    pass
functions = [name for name, obj in inspect.getmembers(sys.modules[__name__],
    inspect.isfunction)]
print(functions)
Finding All Defined Functions in Python Environment