"""Fun with a label, a button and a callback.""" from Tkinter import * class App: def __init__(self, parent): self.parent = parent self.create_widgets() def create_widgets(self): self.label1 = Label( self.parent, text="Hello world") self.label1.pack() self.button1 = Button( self.parent, text="Just do it", command=self.do_it) self.button1.pack() def do_it(self): self.label1.config( text="I'm doing it!") # Boilerplate from here on... if __name__ == '__main__': root = Tk() app = App(root) root.mainloop()