我是编码的新手,所以也许答案对您来说很明显,但是请尝试理解。 我在jupyter中编写了小部件的代码,效果很好。
def some_function():
"""
generates accordion widget
"""
pre_prepared_trimming_option = widgets.Select(options=["whatever", "some_other_choice", "onemore"],
value="whatever",
description='Trim-Type:',disabled=False,
)
txt_ind1= widgets.Text(value='GTAC', placeholder='Your Sequence',
description='Input here:', disabled=False
)
accordion1 = widgets.Accordion(children=[txt_ind1])
accordion2 = widgets.Accordion(children=[VBox([pre_prepared_trimming_option])])
accordion1.set_title(0, 'Paste Your Sequence below')
accordion2.set_title(0, 'Choose from options below')
tab_nest = widgets.Tab()
tab_nest.children = [accordion1, accordion2]
tab_nest.set_title(0, 'User defined')
tab_nest.set_title(1, 'program based')
return tab_nest
some_function()
我的问题:
我如何不仅获得tab_nest(手风琴小部件)的回报,还获得1.文本小部件和2.选择小部件的值?
我知道您可以以元组或列表的形式返回多个收益... 但这庄严地适用于str,float或int格式的输出(据我所记得)。
---我想要什么:从文本中显示手风琴和值或选择小部件
感谢您的帮助