V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
yellowtail
V2EX  ›  Python

小白问一下 jupyternotebook 里点 kernel shutdown 和 interrupt 区别在哪。。主要不太明白 interrupt

  •  
  •   yellowtail · 2019-09-09 01:07:31 +08:00 · 3067 次点击
    这是一个创建于 1681 天前的主题,其中的信息可能已经有所发展或是发生改变。

    自己写的程序里面,如果使用 interrupt 中断然后 run 和 shutdown 再 run 得到的有时东西不一样,但是有时又一样。。。

    2 条回复    2019-09-09 08:25:32 +08:00
    labnotok
        1
    labnotok  
       2019-09-09 01:22:13 +08:00 via Android   ❤️ 1
    粗略的说,
    interrupt 是终止一个 cell,不影响跑过的 cell
    shutdown 是终止一个 ipython kernel,kernel 的堆栈直接清空

    至于结果一不一样,那是随机数没设 seed 吧
    GrayXu
        2
    GrayXu  
       2019-09-09 08:25:32 +08:00
    关闭和中断。
    中断==ctrl+c,中断当前 shell 的任务,保留其他中间态。
    关闭等于关闭这个 notebook 绑定的 python 程序,所有 shell 中间态丢失。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   4177 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 05:23 · PVG 13:23 · LAX 22:23 · JFK 01:23
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.