Is there a way to create a widget in an Ipython notebook and to read out the state of this widget at a different position in the code?
I tried using
from ipywidgets import interact
def f(x):
pass
interact(f,x=True)
As a result, f(x)
is executed when I klick the generated checkmark. This is not what I need. Instead, I would like to read out the state of the ckeckmark at a different position in the code. What is the best way to implement that?