I think this comes down to how Jupyter / JupyterLab handles a server that's started in a cell and how it lets you terminate it. This thread has some approaches that might be more convenient than restarting the whole kernel:
I think this comes down to how Jupyter / JupyterLab handles a server that's started in a cell and how it lets you terminate it. This thread has some approaches that might be more convenient than restarting the whole kernel: