How to generate a widget based on selecting an option from a dropdown menu? I have an example code is given below?
from ipywidgets import * x = Dropdown(options=['a', 'b']) #y = Dropdown(options=['1', '2']) x.observe(change_x, 'value') HBox([x]) For example, based on selecting 'a' It should create and display a second drop-down menu 'y' and on selecting 'b' It should create and display a text box.
Thank you.
https://stackoverflow.com/questions/66057009/how-to-create-a-nasted-widget-based-on-selecting-a-choice-from-a-dropdown-in-jup February 05, 2021 at 11:06AM
没有评论:
发表评论