You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While I was creating #573, I thought it'd be nice to modify the periodic callback period or remove it completely.
import panel as pn
import numpy as np
pn.extension()
def generate_random_number(event=None):
static_text.value = np.random.randint(low=100000, high=200000)
static_text = pn.widgets.StaticText(name='Periodic Random Number Generator',
value='000000')
static_text.add_periodic_callback(generate_random_number,
period=5000) # period in milliseconds
request_button = pn.widgets.Button(name='Request New Number')
request_button.on_click(generate_random_number)
col = pn.Column(request_button, static_text)
col.servable()
Add something like
static_text.remove_periodic_callback()
Similar to static_text.param.unwatch
Also,
static_text.periodic_callback.period = 1000
Similar to static_text.value = 'something else'
The text was updated successfully, but these errors were encountered:
philippjfr
changed the title
Removing a periodic callback / adjusting a periodic callback period
Document removing and adjusting a periodic callback period
Aug 6, 2019
While I was creating #573, I thought it'd be nice to modify the periodic callback period or remove it completely.
Add something like
Similar to
static_text.param.unwatch
Also,
Similar to
static_text.value = 'something else'
The text was updated successfully, but these errors were encountered: