Created
February 23, 2017 19:49
-
-
Save Breta01/3fec2b440ee7380501ff5cc518a601ec to your computer and use it in GitHub Desktop.
Handling click on button widget
This file contains hidden or 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
from IPython.display import display, clear_output | |
# Creating and Displaying button | |
button = widgets.Button(description="Button Text!") | |
display(button) | |
# Callback function with button parameter | |
def clicked(b): | |
clear_output() | |
print("Result of button click: ") | |
# Defining callback function | |
button.on_click(clicked) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment