<jupyter_start><jupyter_text>Widget Exercises  Widget basics  Displaying a widgetCreate and display a `Text` widget.  Change that widget's `value` and some of it's other properties.  Discover the other properties by querying the `keys` property of the instance.  *Hint: You'll need to import from IPython.html.widgets and IPython.display.*<jupyter_code>%load soln/displaying.py<jupyter_output><empty_output><jupyter_text>Widget list  Selection widget Create and display one of the selection widgets (dropdown, select, radiobuttons, or togglebuttons).  Use the dictionary syntax to set the list of possible values.  The values should be "Left" = 0, "Center" = 1, and "Right" = 2.  Try reading and setting the value programmatically.<jupyter_code>%load soln/selection.py<jupyter_output><empty_output><jupyter_text>Link Use a link to link the values of a `Textarea` widget and, an `HTML` or `Latex` widget.  Display the widgets and try typing Latex and HTML in the textarea.  *Hint: Look at the Widget Basics notebook for an example of how to use link.*<jupyter_code>%load soln/link.py<jupyter_output><empty_output><jupyter_text>Widget events  on_submit event Create and display a `Text` widget.  Use the `on_submit` event to print the value of the textbox just before you clear the textbox.  *Hint: The `on_submit` callback must accept one argument, the `sender`.*<jupyter_code>%load soln/on_submit.py<jupyter_output><empty_output><jupyter_text>on_trait_change event Create and display a `Text` widget.  Use the `on_trait_change` method to register a callback that prints the value of the textbox without clearing it.  Observe the difference in behavior to Exercise 1.<jupyter_code>%load soln/on_trait_change.py<jupyter_output><empty_output><jupyter_text>Widget styling  Colored text Create and display an `HTML` widget with a value of your choice (i.e. "Hello World").  Use its attributes to change that widget's background color and font color.<jupyter_code>%load soln/colored.py<jupyter_output><empty_output><jupyter_text>Vertical sliders Create an array of 10 or more vertical sliders.  Align the sliders using a container so they look like an equalizer.  *Hint: Refer to the Widget List notebook for an example of how to display a vertical slider.*<jupyter_code>%load soln/sliders.py<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.07340241796200346, 'fraction_numerical': 0.0025906735751295338, 'mean_word_length': 5.794721407624634, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '346775', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 699, 'n_tokens_neox': 693, 'n_words': 277, 'path': 'exercises/Interactive Widgets/Widget Exercises.ipynb', 'repo_name': 'johannpickard/ipython-in-depth', 'size': '2316'}