I have a radio button widget in a Jupyter notebook and I want to save the selected state, preferrably in the notebook json. That doesn't seem to be happening when I save the notebook. The state gets lost and reset when you reopen the notebook. Is there a way to save the state and have it reload?
Saving a Jupter notebook Saving your edits is simple. There is a disk icon in the upper left of the Jupyter tool bar. Click the save icon and your notebook edits are saved.
Jupyter Widgets are interactive browser controls for Jupyter notebooks. Examples include: Basic form controls like sliders, checkboxes, text inputs. Container controls like tabs, accordions, horizontal and vertical layout boxes, grid layouts. Advanced controls like maps, 2d and 3d visualizations, datagrids, and more.
Configuration files Config files are stored by default in the ~/. jupyter directory. Set this environment variable to use a particular directory, other than the default, for Jupyter config files.
Simply install the python ipywidgets package with pip (pip install ipywidgets==7.6. 0) or conda/mamba (conda install -c conda-forge ipywidgets=7.6. 0) and ipywidgets will automatically work in classic Jupyter Notebook and in JupyterLab 3.0.
To save a widget state in a jupyter notebook use Save Notebook Widget State
menu item (Widgets>Save Notebook Widget State). From ipywidgets:
A notebook file may be saved with the current widget state as metadata. This allows the notebook file to be rendered with rendered widgets
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With