this is the problem with the code because I don’t know how to properly explain it
Here is the code in typed form as well
def convert6(tog = [0]): tog[0] = not tog[0] if tog[0]: print('Server DIF Hard ON') difHardS = 1 else: print('Server DIF Hard OFF') difHardS = 0 button3 = tk.Button(self, text="Hard", command=convert6, height=2, width=20) button3.pack() if difHardS = 1:
Advertisement
Answer
You are using difHardS
variable within the method (I assume) which is nowhere defined in the method. This is the problem that the editor describes.