handling implicit prompt request in run time like colab

未关闭
#513 12 条评论 7 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
冷清
技术栈
jupyter, jupyter-notebook, python
领域
backend

调研方向

在 JupyterLab 中使用 !touch something.txt,然后使用 !rm -i something.txt 重现该行为,接着阅读链接的 JupyterLab issue #8522 以了解相关上下文。完成的标准是:通过 magic 命令或原生支持,让隐式运行时提示显示给用户,同时不让内核单元格无限期地保持运行状态。

由索引模型根据 Issue 内容生成。

描述

I've recently encountered this problem that when my code has an implicit user input request, the Jupiter notebook isn't able to handle it and the kernel just keeps running until I manually interrupt it. If I explicitly use an input or read command the kernel will ask me for user input while running in a cell and the problem is for command requiring input without asking explicitly.

The google colab can handles such a situation without any problem and I'm asking for a magic command to do the same in Jupiter notebook and jlab. consider the following example which doesn't have any explicit input or read function associated with it:

!touch something.txt
!rm -i something.txt

If I run this code in colab, a prompt will come up and ask me if I want to delete something.txt. However, if I run the same code in jlab, the kernel keeps running in that cell and I get no prompt or any other output until I interrupt the kernel manually!!

  • So, this is a feature request for a new magic command or native support to watch for implicit input requests in run time, similar to what colab does natively without any magic.
  • The original problem was mentioned here
  • a StackOverflow question regarding this problem was asked here
主要语言
Python
星标
734
派生
411
平均合并
1 天 2 小时
30 天内合并 PR
9

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

ipython/ipykernel 的其他 Issue

查看 ipython/ipykernel 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。