Rerun all cell of the notebook

Hello ! 

On jupyter notebook, you can create a button which will rerun all the cell below him with this code : 

from IPython.display import HTML, Javascript, display

def initialize():
    display(HTML(
        '''
            <script>
                code_show = false;
                function restart_run_all(){
                    IPython.notebook.kernel.restart();
                    setTimeout(function(){
                        IPython.notebook.execute_cells_below();
                    }, 1)
                }
            </script>
            <button onclick="restart_run_all()">Click to Run all Cells</button>
        '''
    ))
initialize()

Unfortunately this doesn't work in Mode notebook, which is a shame because I need to rerun only some of my cell with new input values. I check a bit on the documentation without finding anything, and even try injecting the js in the report with the html editor without any results. Is there another ways to do this that could work on Mode notebook ? 

If not and since that could also be a workaround for me, is there a way to use filters with python plots ? 

Thank you in advance for your time !

Reply Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
Like Follow
  • 2 mths agoLast active
  • 30Views
  • 1 Following