Tkinter Label not showing Int variable
问题 I'm trying to make a simple RPG where as you collect gold it will be showed in a label, but it doesn't!! Here is the code: def start(): Inv=Tk() gold = IntVar(value=78) EtkI2=Label(Inv, textvariable=gold).pack() I'm new to python and especially tkinter so I need help!!! 回答1: The only thing wrong with your code is that you aren't calling the mainloop method of the root window. Once you do that, your code works fine. Here's a slightly modified version that updates the value after 5 seconds: