ipython - 有什么方法可以在编辑模式、Jupyter Notebook 中交换 Enter 和 Shift-Enter 输入命令?

标签 ipython ipython-notebook jupyter-notebook

我刚开始使用 ipython/jupyter notebook。 Shift-Enter(运行当前单元格)和 Enter(插入换行符)命令使用起来令人沮丧。我想在编辑模式下交换这两个输入的命令。

所以:

Shift-Enter:(插入换行符)

输入:(运行当前单元格)

有什么方法可以为 jupyter notebook 重新映射命令?也许是配置文件?听起来 ipython notebook 并不总是以这种方式工作( Enter in the IPython console inserts new line instead of executing current line after kernel restart #2696 )。链接的 github 问题的解决方案似乎是“只需使用 shift-enter”,而我无法在 google 上找到解决方案。

我有以下版本:

ipykernel (4.5.2)
ipython (5.3.0)
jupyter (1.0.0)
notebook (4.4.1)

最佳答案

打开笔记本,在【帮助】下可以找到【编辑键盘快捷键】。对于 5.0 之前的版本,我在下面链接的文档详细说明了可以运行哪些命令来更改快捷方式。

来源:https://jupyter-notebook.readthedocs.io/en/stable/examples/Notebook/Custom%20Keyboard%20Shortcuts.html

关于ipython - 有什么方法可以在编辑模式、Jupyter Notebook 中交换 Enter 和 Shift-Enter 输入命令?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42778349/

相关文章:

python - 我可以在 ipython shell 中重做/撤消吗?

python - 出现错误 "Expected 2D array, got 1D array instead",分割数据集(csv)以形成线性

python - ipython是否有 "set -e"等价物

python - Spyder - IPython 控制台 - 启用跨屏幕宽度打印

jupyter-notebook - Jupyter 笔记本自动完成显示重复选项

ipython-notebook - 如何使用 ipython notebook 进行开发

ipython-notebook - 在笔记本中结合 jupyter/ipython 内核

Python - matplotlib - subplot() 和 subplots() 之间的区别

python - IPython 笔记本不再支持配置文件

python - IPython 手动迭代主循环?