Aug-30-2020, 06:40 AM
I am building an application. And The following code works fine when Button first clicked. But next time button clicked, I get no change. I don't get an error, just get nothing,...the "On: does not change to "Off"
Thank You
def set_drfvalue(): on = 0 if on == 0: drf_label = Label(factor_build,text= "On", fg= "#581003", font = ("sans_serif 10 bold")).place(x =130, y=25) on = 1 else: drf_label2 = Label(factor_build,text= "Off", fg= "#581003", font = ("sans_serif 10 bold")).place(x =130, y=25) on = 0 def build_factors(): my_button20 = Button(factor_build, text = "DRF Speed", width = 15, command = set_drfvalue) my_button20.place(x=10, y=25)I know I must be missing something. But followed a video to a T and no go.
Thank You