Where is inspect() located?

Dave Angel davea at davea.name
Sat Nov 15 23:36:15 EST 2014


Igor Korot <ikorot01 at gmail.com> Wrote in message:
> Hi, ALL,
> 
> C:\Documents and Settings\Igor.FORDANWORK\Desktop\winpdb>python
> Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit
> (Intel)] on win32
> Type "help", "copyright", "credits" or "license" for more information.
>>>> from a.b import c
>>>> print c.classA
> <class 'a.b.c.classA'>

And what is your question here?

>>>> inspect.getmembers(c.classA)
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> NameError: name 'inspect' is not defined

That's because you haven't imported it.

>>>> import lib
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> ImportError: No module named lib

The module is called inspect.

import inspect


> 


-- 
DaveA




More information about the Python-list mailing list