I’m a newbie trying to learn some Python. I’d like to have a button, called button1, change the text of a label, called label1 to “changed”.
Here is my code:
def changeButtonText():
print("phase 0")
label1.setText="changed"
changeButtonText()
When I run it, I get the output from the console “phase 0”, but receive the following error:
NameError: name ‘label1’ is not defined
I am using QT creator, and in fact the label does exist, it’s named ‘label1’. I was hoping I could change attributes of the label (text, even styling) by referring to itself label.
Any help is greatly appreciated. Thank you!