☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

Throttle button

Community Support
Rita_Morgan
Rita_Morgan

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.

value=False
def on_click():
  if value:
    value=False
  else:
    value=True

Trying to do something like that but keep getting UnboundLocalError

⌁   Link to post
Bryan
Bryan

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.

⌁   Link to post

End of archived discussion · Replies are disabled