Imran
Imran

Reputation: 656

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.

Upvotes: 10

Views: 10138

Answers (1)

yl_low
yl_low

Reputation: 1329

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.

Upvotes: 7

Related Questions