Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exporting ipywidgets to a website

I have a Python program in Jupyter Notebook that uses interact from the module ipywidgets.

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

I want someone to be able to open the notebook on a website somewhere and use the interactive widget without requiring Python or anything else, just like here.

like image 799
Imran Avatar asked Oct 17 '22 14:10

Imran


1 Answers

You can check out this website: 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')

According to the docs it produces an export.html file.

like image 144
yl_low Avatar answered Oct 21 '22 00:10

yl_low