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       
How to program with the python language together with tkinter, pygame etc.
Comments
Post a Comment