title: Call a Python method by name
body: <p>If I have an object and a method name in a string, how can I call the method?</p>
  
  <pre><code>class Foo:
      def bar1(self):
          print 1
      def bar2(self):
          print 2
  
  def callMethod(o, name):
      ???
  
  f = Foo()
  callMethod(f, "bar1")
  </code></pre>