I am trying to learn how to make panel useful to me. Note, I do not use jupyter notebooks and am not that familiar with them, all work is done in a .py script. The first question is how do I have “events” in panel get updated by the external browser gui. (An example of what I want to do is below).
The second question is the script only works if the standard name == “main” is commented out when I run bokeh serve myfile.py . Is that by design?
for element in (ar): if stop_button.value == True: print('Stopped!') stop_button.value = False break #Do some things print('Still running')
if name == “main”:
css = ‘’’
border: 1px black solid;
array = np.linspace(0,100,1000)
start_button = pn.widgets.Button(name=‘Start’, margin=(5, 5, 5, 5),button_type=‘primary’)
stop_button = pn.widgets.Toggle(name=‘Stop’, margin=(5, 5, 5, 5),button_type=‘danger’)
col = pn.Column(start_button,stop_button,css_classes=[‘panel-widget-box’])