Feb-21-2021, 06:21 PM
(This post was last modified: Feb-21-2021, 06:21 PM by BashBedlam.)
This should help:
from tkinter import Tk, Button button_tries = -1 def change_button (event) : global button_tries tries = ('Second', 'Third') button_tries += 1 if button_tries <= 1 : button.configure (text = f'{tries [button_tries]} Try') window = Tk () button = Button (window, text = 'First Try') button.pack (padx = 10, pady = 10) window.bind ('<Return>', change_button) window.mainloop ()Press Return to change the button text.