Home > front end >  Increase text of the dropdown menu - Python
Increase text of the dropdown menu - Python

Time:04-27

I am trying to create dropdown menu using the following code on Python.

pqrs = ['Segment1', 'Segment2', 'Segment3']

#Segment Criteria
Segment_selected = widgets.Text()
# print('=' * term_size.columns)
# print('\n'  "\033[1m"   'Select a Segment criteria for Selecting HCP Universe'   "\033[0m")
# python code to run in jupyter notebook

from ipywidgets import interact, interactive, Layout
def lx(Segmentation):
    Segment_selected.value = str(Segmentation)
int_widget = interactive(lx, Segmentation=pqrs,)
int_widget.children[0].layout = Layout(width='400px',height = '40px')
display(int_widget)

This is generating the following output: yupiter

The essential documentation for this is here: Widget Styling#Description

Try "auto" or "initial" for auto-fitting the description_width.

  • Related