How to prevent Google Colab from disconnecting?
I don't believe the JavaScript solutions work anymore. I was doing it from within my notebook with: from IPython.display import display, HTML js = (' function ConnectButton(){ ' 'console.log("Connect pushed"); ' 'document.querySelector("#connect").click()} ' 'setInterval(ConnectButton,3000); ') display(HTML(js)) When you first do a Run all (before the JavaScript or Python code has started), the console displays: Connected to wss://colab.research.google.com/api/kernels/0e1ce105-0127-4758-90e48cf801ce01a3/channels?session_id=5d8...
https://stackoverflow.com/questions/57113226/how-to-prevent-google-colab-from-disconnecting