from tkinter import* Window = Tk() def YourCommand(): print ("Button Clicked") button = Button(Window, text="Click Me", command=YourCommand)