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
You can also define a textvariable
when creating the Label, and change the textvariable to update the text in the label.
Here's an example:
labelText = Stringvar()
depositLabel = Label(self, textvariable=labelText)
depositLabel.grid()
def updateDepositLabel(txt) # you may have to use *args in some cases
labelText.set(txt)
There's no need to update the text in depositLabel
manually. Tk does that for you.