So I have written this piece of code in python3 guizero to change colour to red when I click the button I created. But whatever I do it's not working! I am not sure what I did wrong but it just won't work (I used Visual Studio Code but it didn't give me any errors or say the code was wrong.) So I figured this will be the best place to come. This is the code I wrote:
from guizero import *
red = 255,0,0
def cl_ch():
if mahe_pushbutton.text == "Push":
mahe_text.text_colour = red
else:
print("Not working")
mahe_app = App(title = "TEST")
mahe_text = Text(mahe_app, text = "test test", font = "Orbitron", size = 20)
mahe_textbox = TextBox(mahe_app, width = 50)
mahe_pushbutton = PushButton(mahe_app, command=cl_ch, text = "Push")
mahe_pushbutton.width = 60
mahe_pushbutton.height = 3
mahe_app.display()
Thanks if you are able to help!