Skip to content

Instantly share code, notes, and snippets.

@kervel
Created April 2, 2020 14:41
Show Gist options
  • Save kervel/f7eafb4aa08b200f9298becb557bbf33 to your computer and use it in GitHub Desktop.
Save kervel/f7eafb4aa08b200f9298becb557bbf33 to your computer and use it in GitHub Desktop.
def say_something(x):
"""
Print the current widget value in short sentence
"""
print(f'Widget says: {x}')
widgets.interact(say_something, x=[0, 1, 2, 3])
widgets.interact(say_something, x=(0, 10, 1))
widgets.interact(say_something, x=(0, 10, .5))
_ = widgets.interact(say_something, x=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment