如何从笔记本中的 javascript 查询 ipython (jupyterlab?) 内核?

How to query ipython (jupyterlab?) kernel from javascript in the notebook?

您可以编写一些 html 和 js 并在笔记本中显示内容,但是查询 "backend" 的标准方法是什么...即向 python 进程发送请求驱动笔记本?

使用 Jupyter 消息传递协议:
https://jupyter-client.readthedocs.io/en/stable/messaging.html