Reputation: 1323
In creating an ipython dropdown widget,
from IPython.html import widgets
from IPython.display import display
d = {"1": "a", "2": "b"}
dropdown = widgets.Dropdown(options=d)
display(dropdown)
I can use
print dropdown.value
to print the value of the selected key from the dropdown widget. How can I obtain the key ("1", "2") that is clicked in the dropdown? Using
print dropdown.key
does not work.
Upvotes: 1
Views: 1421