def __init__(self):
    for i in range(10):
        name = 'Button %d' % i
button = wx.Button(parent, -1, name)
func = functools.partial(self.on_button, name=name)
button.Bind(wx.EVT_BUTTON, func)

def on_button(self, event, name):
    print('%s clicked' % name)
Best way to get the name of a button that called an event?