Finding all classes in a module

Michael Gilfix mgilfix at eecs.tufts.edu
Fri Aug 9 03:28:00 EDT 2002


  Perhaps something along the lines of:

    import types
    import mymodule
    for name in mymodule.__dict__.keys ():
       if type (mymodule.__dict__[name]) == types.ClassType:
         print name

                 -- Mike

On Fri, Aug 09 @ 16:15, Tom Harris wrote:
> If I import a module, how do I find the names of the class objects it
> contains?

-- 
Michael Gilfix
mgilfix at eecs.tufts.edu

For my gpg public key:
http://www.eecs.tufts.edu/~mgilfix/contact.html"




More information about the Python-list mailing list