Adding function to button

PHOTO EMBED

Tue Aug 17 2021 15:19:32 GMT+0000 (Coordinated Universal Time)

Saved by @maryjaay666 #html

from tkinter import *
root = Tk()

# Creating function for button


def myClick():
    myLabel = Label(root, text="Look! I clicked a button")
    myLabel.pack()


# Defining a button
myButton = Button(root, text="Click ME!", command=myClick)
myButton.pack()


root.mainloop()
content_copyCOPY