Assuming that you have loaded a function but you do not know the code. We will provide an example of how you can get the source code. Assume that have the following function:
def my_addition(a,b): return a+b my_addition(5,6)
We get:
11
We can get the source code by using the inspect
module:
import inspect lines = inspect.getsource(my_addition) print(lines)
And we get the source code of the function:
def my_addition(a,b): return a+b