I'm trying to write a single function that turn to true when a variable changes. The script should put the variable in a list and check if it changes. Now, I need to call the function in another loop, so the script have to do one cicle when invoked for i in range(0, 1)
Anyway the function doesn't work and the output is always false...any suggestions?
(NOOB)
def change():
v1 = []
for i in range(0, 1):
v1.insert(0, get.value()) #get.value gave a value when invoked
if len(v1) > 2:
if v1[0] != v1[1]:
v1.clear()
v1.insert(0, get.value())
return True
else:
return False