Retracing your steps in an interactive python env

TerryP bigboss1964 at gmail.com
Mon Sep 14 19:50:09 EDT 2009


I'm not sure what the best way to do this is, other then that it would
mean asking the interp to explain it in a format we understand ;).


In the (c)python library reference, I see an inspect module that
sounds like it should be useful, but it doesn't work on my test case
here:

>>> def foo(x, y):
...  print(x+y)
...
>>> inspect.getsource(foo)
(throws IOError: could not get source code)

Perhaps someone else has more experience on the matter.

--

TerryP.



More information about the Python-list mailing list