Changing the text on a label

前端 未结 6 1515
长情又很酷
长情又很酷 2020-11-28 10:43

I am having trouble with using a key binding to change the value of a label or any parameter. This is my code:

from tkinter import*

class MyGUI:
  def __ini         


        
6条回答
  •  清歌不尽
    2020-11-28 10:49

    Use the config method to change the value of the label:

    top = Tk()
    
    l = Label(top)
    l.pack()
    
    l.config(text = "Hello World", width = "50")
    

提交回复
热议问题