Update a label in Tkinter when pressing a button

前端 未结 3 854
野的像风
野的像风 2021-01-24 04:34

I want to make a \"program\" that updates a label when you press a button and print out a variable, but with the code i have it does not work. Can someone help me out?

T

3条回答
  •  灰色年华
    2021-01-24 04:44

    Instead of label_1.update() (which doesn't do anything close to what you think it does), reconfigure the widget with label_1.config(text=x).

提交回复
热议问题