Jupyter notebook run all cells on open

后端 未结 3 616
猫巷女王i
猫巷女王i 2020-12-08 05:57

I have a Jupyter 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

3条回答
  •  遥遥无期
    2020-12-08 06:19

    1. Paste the snippet below in a normal(code) cell,
    2. execute it (hit [Ctrl + Enter]), and
    3. Save the notebook.

    The next time you (re)load it, all cells will run and a checkpoint will be saved with their refreshed outputs.

    %%html
    
    

    Note that if you clear the output of the above cell, you have to repeat steps 2 and 3.

    TIP

    You may consider these more appropriate solutions for what you are probably trying to achieve:

    • Jupyer Thebe: embed code-snippets in static pages communicating with ipython-kernels backends.
    • nteractnteract: Build Electron-based applications from notebooks.
    • Dashboards: The "official"efforts to allow to pre-configure a grid of notebook-cell outputs ("dashboards"), package and serve them as standalone web apps.

    You can find a summary of the situation in this article.

    Controversy

    Similar questions has been asked before in other sites, but in this googlegroup thread, someone submitted a solution, and the group moderator erased it(!), obviously to preserve life on earth :-) So, be careful with it!

提交回复
热议问题