javascript - 将 ipywidgets 导出到网站

标签 javascript python html jupyter-notebook ipywidgets

我在 Jupyter Notebook 中有一个 Python 程序,它使用 ipywidgets 模块中的 interact

interact(my_func, filter_by=filter_by_list, format_type=format_dict.keys())

我希望有人能够在某处的网站上打开笔记本并使用交互式小部件,而不需要 Python 或其他任何东西,就像 here .

最佳答案

您可以查看此网站:http://ipywidgets.readthedocs.io/en/latest/embedding.html#python-interface

from ipywidgets import IntSlider
from ipywidgets.embed import embed_minimal_html

slider = IntSlider(value=40)
embed_minimal_html('export.html', views=[slider], title='Widgets export')

根据文档,它生成一个 export.html 文件。

关于javascript - 将 ipywidgets 导出到网站,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43254861/

相关文章:

JavaScript For 循环,用户输入错误

javascript - 捕捉 ASP.NET 的 Response.Redirect

python - PyQt QVBoxLayout 和缺少的小部件?

javascript - 使菜单在点击任意屏幕时消失

JavaScript 可在单击时更改网格单元格的背景颜色

javascript - angularJS倒数计时器按降序排列

python - 删除多级索引 pandas 的一个级别的元素

Python:使用两个按不同方向排序的键对列表进行排序

javascript - 按下 Tab 键时可编辑表格内容

html - 如何设置 <td> 宽度以在视觉上截断其显示的内容?