<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def button(self, name, filename, command):
        '''add a button'''
        try:
            img = LoadImage(filename)
            b = Tkinter.Button(self.frame, image=img, command=command)
            b.image = img
        except Exception:
            b = Tkinter.Button(self.frame, text=filename, command=command)
        b.pack(side=Tkinter.LEFT)
        self.buttons[name] = b