Insane crazy question - printing commands

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Tue Nov 6 12:42:46 EST 2007


On Tue, 06 Nov 2007 19:42:08 +0200, Donn wrote:

> 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 ?
>     import inspect
>   
> File "/home/donn/Projects/pythoning/fontyPython/extending/cairotests/containers/inspect.py", 
> line 9, in ?
>     print inspect.getsource(x.draw)
> AttributeError: 'module' object has no attribute 'getsource'

Look where the error occurs: in a module named `inspect.py` that is
definitely not the one from the standard libarary.  If that module has an
``import inspect`` it imports *itself*!

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list