def import_attribute(name):
 (path, attr) = name.rsplit('.', 1)
 module = __import__(path, globals(), locals(), [attr])
 return getattr(module, attr)

def import_attribute ( name ) : ( path , attr ) = name . rsplit ( '.' , 1 ) module = __import__ ( path , globals ( ) , locals ( ) , [ attr ] ) return getattr ( module , attr )
import attribute using string reference .