我安装了一个新的VS代码版本1.50.1,带有python扩展,现在添加了Jupyter扩展。Jupyter扩展版本号为2020.12.411183115。当我按shift键时,默认情况下,它会在下面添加一个新行。您可以在视频中看到,shift+enter应该可以运行该行。此时,在交互式窗口中运行代码的唯一方法是使用ctrl+shift+p并选择RunSelected cell
在与Danny Varod合作后编辑以下评论:
将键盘快捷键更改为ctrl+enter时,不会发生任何事情(不会在下面添加新行)。我按ctrl+shift+p,我看到正确的快捷方式是crtl+enter,但它不会触发操作
这是更改前我的键盘快捷键的屏幕截图
更改我的键盘快捷键以匹配下面的注释。现在,当我按下ctrl+enter键时,什么也没有发生
在
settings.json
中.vscode
下添加以下行:那么
Shift+Enter
就应该起作用了请使用以下快捷键设置:
此快捷键是根据使用条件设置的,只有在确认(包括打开控制面板)后才能使用。因此,我们可以删除此快捷键的使用条件
Shift+Enter
还为我插入了一行新行,取消映射阻止了这一点我将映射更改为:
然而,这些映射对我来说是有效的,在Jupyter笔记本(
.ipynb
)中,Ctrl+Enter
和Shift+Enter
与我定义的进行了交换🤔.此外,我正在使用以下Python扩展:
magicstack.magicpython
ms-toolsai.jupyter
两者均由安装者安装:
donjayamanne.python-extension-pack
当我打开
.ipynb
文件时,它们会作为Jupyter笔记本打开。 当我打开.py
文件时,我可以使用Jupyter或MagicPython(或者说Python)相关问题 更多 >
编程相关推荐