from Tkinter import * def what_to_do_for_button1(): print "You clickked the button." def main(): main_window = Tk() b1 = Button(main_window, text="Click", command=what_to_do_for_button1) quit_b = Button(main_window, text="Quit", command=main_window.quit) b1.pack() quit_b.pack() main_window.mainloop() main()