5

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

Debayan Paul
  • 95
  • 2
  • 9
  • It looks like this is pretty difficult to do with colab due to security reasons. See [here](https://stackoverflow.com/questions/65984431/run-all-cells-command-in-google-colab-programmatically) and [here](https://stackoverflow.com/questions/53919284/how-to-simulate-python-key-presses-in-google-collab-notebook) – jylls Feb 03 '22 at 15:34

0 Answers0