通常,如果网络连接丢失或网络浏览器在单元格运行时关闭,我必须从头开始再次运行单元格。
为了解决这个问题,我将 .ipynb 转换为 .py 并使用了 'nohup python .py'
有什么方法可以防止运行中的细胞像 nohup 一样停止?
提前谢谢你。
最佳答案
您可以在不同的线程中启动您的进程。
def network_call():
# Do something here
threading.Thread(target=network_call).start()
move_ahead()
关于python - Jupyter如何在后台运行单元格?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56076916/