I have an IPython noteboook and I'm trying to set it up in a way so that all cells are ran automatically when the notebook is opened.
This behaviour is different from saved output for notebooks which contain widgets. Widgets only seem to get rendered for me when the cells containing them are run. Consider the following example:
from IPython.display import display
from IPython.html.widgets import IntSlider
w = IntSlider()
display(w)
The slider is not displayed until the cell is executed.
Is this something that can be accomplished through Notebook Metadata or configuration files?
EDIT: https://try.jupyter.org/ seems to be doing something like this: Notice that the notebooks are not running when you open the page and display output when they are opened.
EDIT2: Adding example.
解决方案
I just found a way to do this quite easily. If you install the nbextensions package (https://github.com/ipython-contrib/jupyter_contrib_nbextensions), one of the extensions is called "Initialization cells" and allows you to mark certain cells to run automatically when the notebook is loaded.