Question: If I have a Python class, and would like to call a function from it depending on a variable, how would I do so? I imagined following could do it:

```
class CallMe: # Class

   def App(): # Method one

      ...

   def Foo(): # Method two

      ...

variable = "App" # Method to call

CallMe.variable() # Calling App()

```

But it couldn't. Any other way to do this?

Answer: 
You can do this:

```
getattr(CallMe, variable)()

```

[getattr](http://docs.python.org/library/functions.html#getattr) is a builtin method, it returns the value of the named attributed of object. The value in this case is a method object that you can call with ()
Your code does not look like python, may be you want to do like this?

```
class CallMe:

    def App(self): #// Method one
        print "hello"

    def Foo(self): #// Method two
        return None

    variable = App #// Method to call

CallMe().variable() #// Calling App()

```