Duplicate of..
- How can I get the code of python function?
- print the code which defined a lambda function
- Python: How do you get Python to write down the code of a function it has in memory?
I have a method definition which is successfully running, but would like to modify it in runtime.
for eg: If i have a method
def sayHello():
print "Hello"
type(sayHello) gives me the answer 'type function'. Will I able to get the source code string of this function object. Is it considered a security issue ?