Widgets for Jupyter notebook¶
Let's import the module ipywidgets into the Jupyter Notebook
from ipywidgets import widgets
from ipywidgets import *
from traitlets import *
Now we import the display function from IPython¶
- let's attach a function to the event on_submit
- After we run this cell, we can go up and write something in the text widget and after you submit the text you wrote will be printed after the cell
from IPython.display import display
text = widgets.Text()
display(text)
def handle_submit(sender):
print("Thank you for entering this text:",text.value)
text.on_submit(handle_submit)
Thank you for entering this text: Ciao
awesome post presented by you..your writing style is fabulous and keep update with your blogs
ReplyDeletepython online training hyderabad
thank you Sam! Maybe I will come back updating it.
Deleteit i s nice blog Thank you porovide paython progrs importent information it is very under standful i think it is used to for all . and i am searching for same information to save my time.
ReplyDeleteworkday Online Training india
Thank you sanvi
Delete