删除单元格 ipython 2.0

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23619989/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 03:14:39  来源:igfitidea点击:

Delete cell ipython 2.0

pythonkeyboard-shortcutsipython

提问by pbreach

There is probably a very easy solution to this but I'm not sure what it is. Delete cell command in IPython 1.2 used to be:

对此可能有一个非常简单的解决方案,但我不确定它是什么。IPython 1.2 中的删除单元格命令曾经是:

ctrl-m d

according to the help menu in version 2.0 it says,

根据 2.0 版中的帮助菜单,它说,

Shift-d: delete cell(press twice) 

I've tried holding shiftthen pressing dtwice and various combinations with shiftand dand nothing seems to work.. Am I just doing this wrong or the command is actually not working? Any help would be appreciated.

我试过按住shift然后按d两次和各种组合shiftd和似乎没有任何作用..我只是做错了还是命令实际上不起作用?任何帮助,将不胜感激。

采纳答案by dmvianna

In the new IPython cells could have two states: when it has a green selection rectangle around it you can edit what's inside; when it has a grey rectangle around it you edit the cell itself (copy/paste/delete). Enter/Return makes it go green, Esc makes it go grey. When it is gray, 'dd' will delete it.

在新的 IPython 单元格中可以有两种状态:当它周围有一个绿色的选择矩形时,你可以编辑里面的内容;当它周围有一个灰色矩形时,您可以编辑单元格本身(复制/粘贴/删除)。Enter/Return 使其变为绿色,Esc 使其变为灰色。当它是灰色时,'dd' 将删除它。

回答by agconti

To delete a cell, just click on the part margin part of the cell, the part that is not code or output ( right below the Ln[7]: in the picture below), and simply press the dkey twice. Clicking there selects the entire cell and allows you to use keyboard short cuts like delete and or create a cell above or below.

要删除一个单元格,只需单击单元格的部分边距部分,即不是代码或输出的部分(下图中 Ln[7]: 的正下方),只需按d两次键即可。单击此处可选择整个单元格,并允许您使用键盘快捷键,例如删除和/或在上方或下方创建单元格。

enter image description here

在此处输入图片说明