1#baz.py
2import inspect
3class foo:
4 def bar():
5 print 'Hello'
6print(inspect.getsource(foo))
1from inspect import getmembers, isfunction
2from my_project import my_module
3
4functions_list = [o for o in getmembers(my_module) if isfunction(o[1])]