Mohan Parthasarathy escribió:
Hi,
I am new to Python. I tried searching this but could not find an answer.
In the interactive shell, I write a new function and I want to be able
to see all the code that I wrote at a later time. Just typing the
function name only shows
>>> allmethods
<function allmethods at 0x822b0>
How do I see the actual code ?
thanks
mohan
I think that is not possible (at least, not with the default python
console and without doing introspection).
Anyway, why you need to do that? Why not write down the script in a text
file and run it?
If you need to "run a console" inside a function so that you can inspect
variables, maybe you can use:
import pdb;pdb.set_trace()
And that will start a debug session when gets executed.
Hope that helps.
--
http://mail.python.org/mailman/listinfo/python-list