FAQ
Robert Dickinson
I am trying to get info about the classes in my running system. Having
gotten the modules, I wanted to get the classes defined in them. However,
classes = inspect.getmembers(module,inspect.isclass)
Hmmm.... this works for me:

C:\>python
ActivePython 2.1, build 210 ActiveState)
based on Python 2.1 (#15, Apr 19 2001, 10:28:27) [MSC 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
import urllib
import inspect
classes = inspect.getmembers(urllib,inspect.isclass)
for ii in classes: ii
...
('FancyURLopener', <class urllib.FancyURLopener at 0080C0D4>)
('URLopener', <class urllib.URLopener at 00815894>)
('addbase', <class urllib.addbase at 00816DF4>)
('addclosehook', <class urllib.addclosehook at 00816E64>)
('addinfo', <class urllib.addinfo at 00818874>)
('addinfourl', <class urllib.addinfourl at 008188E4>)
('ftpwrapper', <class urllib.ftpwrapper at 007E500C>)
>>>

--

Emile van Sebille
emile at fenx.com

---------

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 5 | next ›
Discussion Overview
grouppython-list @
categoriespython
postedAug 19, '02 at 11:01p
activeAug 20, '02 at 5:29p
posts5
users4
websitepython.org

People

Translate

site design / logo © 2022 Grokbase