Learn Before
Concept
Adding Event Listener to Button
We can add an event listener function to a button by passing a call-back function to command parameter. ```command=someFunction"
import tkinter as tk window = tk.Tk() def printInfo: print("clicked....") button = tk.Button(text="Login", command=printInfo) button.pack() window.mainloop()

0
1
Updated 2021-05-10
Tags
Python Programming Language
Data Science