栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

ipywidgets:根据另一个部件的结果更新一个部件

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

ipywidgets:根据另一个部件的结果更新一个部件

您可以在分配给的过程中保留有关的通知

options

with search_result.hold_trait_notifications():    search_result.options = titles

从而:

search_text = widgets.Text(description = 'Search') search_result = widgets.Select(description = 'Select table')def search_action(sender):    phrase = search_text.value    df = search(phrase) # A function that returns the results in a pandas df    titles = df['title'].tolist()    with search_result.hold_trait_notifications():        search_result.options = titles

请参阅下面的hmelberg解释

“错误的根源是该窗口小部件还具有value属性,并且该值可能不在新的选项列表中。因此,窗口小部件的值可能会在短时间内被“孤立”,从而产生错误。”



转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/660141.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号