Insane crazy question - printing commands
donn.ingle at gmail.com
Tue Nov 6 18:42:08 CET 2007
> import inspect
> class Box:
> def draw(self):
> print "hi"
> return 3
> x = Box()
> print inspect.getsource(x.draw)
Tried that, but get this error. I did a dir(inspect) in the command env. and
getsource it definitely there...
Traceback (most recent call last):
File "inspect.py", line 1, in ?
line 9, in ?
AttributeError: 'module' object has no attribute 'getsource'
More information about the Python-list