>[danger] ##### 方法一 利用 getattr() ~~~ import math class Point: def __init__(self, x, y): self.x = x self.y = y def __repr__(self): return 'Point({!r:},{!r:})'.format(self.x, self.y) def distance(self, x, y): return math.hypot(self.x - x, self.y - y) p = Point(2, 3) # 对象 去 点方法 其中方法字符串 d = getattr(p, 'distance')(0, 0) # Calls p.distance(0, 0) ~~~