tkinter when button pressed code example
Example 1: how to find the text inside button in tkinter
my_text = my_button.cget('text')
Example 2: python button tkinter
from tkinter import *
wow = Tk()
def ree(hi):
print(hi)
w = Button ( master=wow, command=ree('hi'), text="hi" )
Output:
Tkinter:
______
[ hi ] <--- Button
------
Shell:
hi <--- on button pressed