Python 3, Tkinter, How to update button text

后端 未结 7 1722
孤城傲影
孤城傲影 2020-12-06 08:41

Im trying to make it so that when the user clicks a button, it becomes \"X\" or \"0\" (Depending on their team). How can I make it so that the text on the button is updated?

7条回答
  •  鱼传尺愫
    2020-12-06 08:51

    To sum up this thread: button.config and button.configure both work fine!

    button.config(text="hello")
    

    or

    button.configure(text="hello")
    

提交回复
热议问题