from tkinter import * from tkinter.ttk import * def my_button_behavior(): '''executes when the 'hello' button is clicked''' button_text.set('You clicked me!') def main(): window = Tk() # create the main program window global button_text button_text = StringVar() button_text.set('Click me') button = Button(window, textvariable=button_text, command=my_button_behavior) button.grid(row=0, column=0) button.configure(padding=50) window.mainloop() # enter the GUI main loop main()