see variables and methods associated with a python object
February 24th, 2011 by Lawrence David
when debugging or trying to understand someone else’s python code, it can be helpful to know what variables and methods are associated with an object. Â to get that information, use the dir() method:
(Pdb) dir(pylab.cm.RdBu)
['N', '__call__', '__doc__', '__init__', '__module__', '_gamma', '_i_bad', '_i_over', '_i_under', '_init', '_isinit', '_lut', '_rgba_bad', '_rgba_over', '_rgba_under', '_segmentdata', '_set_extremes', 'from_list', 'is_gray', 'monochrome', 'name', 'set_bad', 'set_gamma', 'set_over', 'set_under']