I have this very simple function inside an object:
def ctrl_btn_press(self, event):
print event.GetEventObject().GetName()
getattr(self, event.GetEventObject().GetName())
Event is a wxpython Event. The names are in a list in a config file and buttons in my gui are set to the names of functions in this event handler object that will handle that button press.
The print works, it prints, for example, "alm_switch_away". The function call getattr doesn't work, however. This is the function it is supposed to call (with print functions to test if the code "got there") but nothing gets printed:
def alm_switch_away(self):
print "HERE!"
Can you see what I'm doing incorrectly?