Run all cells below when a button is clicked in Google Colab

Viewed 416

I am trying to create a button with Placeholder text which after clicking runs all cells below it automatically. I am trying this in Google Colab.

My earlier solution for Jupyter notebook seems to stop working in Colab:

from IPython.display import display, Javascript
from IPython.core.display import HTML
HTML('''<script> </script> <form action="javascript:IPython.notebook.execute_cells_below()"><input type="submit" id="toggleButton" value="Generate Report"></form>''')

Does anyone know a probable fix or any alternate solution for this?

Thanks,

Debayan

0 Answers
Related