获取Jupyter小部件上的键盘事件

2024-06-09 01:00:34 发布

您现在位置:Python中文网/ 问答频道 /正文

我在Jupyter有一个文本框,如下所示:

import ipywidgets as widgets
from IPython.display import display, clear_outpu
tagInput = widgets.Text()

并尝试使用以下代码获取诸如Enter之类的键盘事件:

^{pr2}$

但是,它只捕捉到价值的变化。怎么解决这个问题?在


Tags: 代码textfromimportasipythondisplayjupyter