I have a script that goes like this
w = False
class A(object):
@property
def is_w(self):
global w
return w
@w.setter
def is_w(self, value):
global w
w = value
self.listen(value)
def listen(self,w_):
if w_:
print("worked!")
w = False
def value_change(self):
global w
w = True
I need the listen() function to run whenever the w value becomes true and stops when it's false again. the w value changes when another function changes it for example here the value_change() function
However I get this error AttributeError: 'bool' object has no attribute 'setter'