getattr with module : getattr « Buildin Function « Python Tutorial






import math
print math.abs
print getattr(math, "abs")   

object = math
method = "abs" 
print getattr(object, method)                       
print type(getattr(object, method))








13.19.getattr
13.19.1.Getting Object References with getattr
13.19.2.getattr with module