Throttle button

Is there a good example to throttle?

I have a single button. The button turns on and off something. But, I keep having variable scope issues.

def on_click():
  if value:

Trying to do something like that but keep getting UnboundLocalError

To do thins this way you would need to put global value as the very first line in the callback function. In Python you can read from values outside a function, but assignments to variables inside functions are assumed to be local to the function, unless explicitly made global.