Skip to content

Instantly share code, notes, and snippets.

@jingningzhang1
Created June 24, 2022 22:51
Show Gist options
  • Save jingningzhang1/29ed59ce530be9abbfd2a379128f40f0 to your computer and use it in GitHub Desktop.
Save jingningzhang1/29ed59ce530be9abbfd2a379128f40f0 to your computer and use it in GitHub Desktop.
@callback(Output("time", "children"), Input("interval", "n_intervals"))
def refresh_data_at_interval(interval_trigger):
"""
This simple callback demonstrates how to use the Interval component to update data at a regular interval.
This particular example updates time every second, however, you can subsitute this data query with any acquisition method your product requires.
"""
return dt.datetime.now().strftime("%M:%S")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment