Created
July 28, 2023 12:02
-
-
Save EnkrateiaLucca/17856a8d02891d9eaff135d1813e3d2d to your computer and use it in GitHub Desktop.
a bunch of jupyter widgets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Real-time Updates: | |
import ipywidgets as widgets | |
from IPython.display import display | |
output = widgets.Output() | |
slider = widgets.IntSlider(description='Slider') | |
def update_output(change): | |
with output: | |
output.clear_output() | |
print(f"Slider value: {change['new']}") | |
slider.observe(update_output, 'value') | |
display(slider, output) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment