dir() list the entities stored within a Python object : dir « Buildin Function « Python Tutorial






class MyClass :
    name = "MyClass"

me = MyClass()
me.color = "red"
print dir(me)

d = dir(me)
for a in d :
    print a








13.12.dir
13.12.1.Using dir to investigate a module
13.12.2.dir function returns a list of the attributes and methods of any object
13.12.3.apply the dir() function to a type as well as a variable
13.12.4.dir() list the entities stored within a Python object