from Tkinter import * def what_to_do_for_button_b1(): print "You clicked the button b1." def what_to_do_for_button_b2(): print "b2 b2 b2 b2." def main(): main_window = Tk() main_window.title("Test Window") main_window.geometry("300x100") b1 = Button(main_window, text="Click", command=what_to_do_for_button_b1) b1.pack() b2 = Button(main_window, text="Click", command=what_to_do_for_button_b2) b2.pack() quit_b = Button(main_window, text="Quit", command=main_window.destroy) quit_b.pack() main_window.mainloop() main()