Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/333.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
交互式窗口中的Visual Studio代码Python运行部分不工作_Python_Visual Studio Code - Fatal编程技术网

交互式窗口中的Visual Studio代码Python运行部分不工作

交互式窗口中的Visual Studio代码Python运行部分不工作,python,visual-studio-code,Python,Visual Studio Code,当我在Visual Studio代码中使用python扩展名处理.py文件时,我曾经能够在交互式窗口中使用Alt+Enter或单击上下文菜单(在所附屏幕截图中高亮显示)运行选定的行。最近,它不再工作了。据我所知,自从上次跑步以来,我没有做任何改变。附加了.json文件中的自定义项 此外,在实验室pc中,我无法在上下文菜单中找到操作。当我在编辑器中选择行并右键单击时,我想知道在何处将其添加到上下文菜单中 电脑设置: Python扩展:2020.1.57204 版本:1.41.1(系统设置) 提交

当我在Visual Studio代码中使用python扩展名处理.py文件时,我曾经能够在交互式窗口中使用Alt+Enter或单击上下文菜单(在所附屏幕截图中高亮显示)运行选定的行。最近,它不再工作了。据我所知,自从上次跑步以来,我没有做任何改变。附加了.json文件中的自定义项

此外,在实验室pc中,我无法在上下文菜单中找到操作。当我在编辑器中选择行并右键单击时,我想知道在何处将其添加到上下文菜单中

电脑设置:

  • Python扩展:2020.1.57204

  • 版本:1.41.1(系统设置)

  • 提交:26076a4de974ead31f97692a0d32f90d735645c0

  • 日期:2019-12-18T14:58:56.166Z

  • 电子:6.1.5

  • 铬:76.0.3809.146

  • Node.js:12.4.0

  • V8:7.6.303.31-电子.0

  • 操作系统:Windows\u NT x64 10.0.18363

“Settings.json”中的设置

keybinds.json中的所有键绑定:

// Place your key bindings in this file to override the defaultsauto[]
[
    {
        "key": "shift+enter",
        "command": "python.datascience.runFileInteractive"
    },
    {
        "key": "shift+enter",
        "command": "-python.datascience.runcurrentcelladvance",
        "when": "editorTextFocus && python.datascience.featureenabled && python.datascience.hascodecells && !editorHasSelection"
    },
    {
        "key": "alt+enter",
        "command": "python.datascience.execSelectionInteractive",
        "when": "editorTextFocus && python.datascience.featureenabled && python.datascience.ownsSelection && !findInputFocussed && !replaceInputFocussed && editorLangId == 'python'"
    },
    {
        "key": "shift+enter",
        "command": "-python.datascience.execSelectionInteractive",
        "when": "editorTextFocus && python.datascience.featureenabled && python.datascience.ownsSelection && !findInputFocussed && !replaceInputFocussed && editorLangId == 'python'"
    },
    {
        "key": "shift+enter",
        "command": "-python.execSelectionInTerminal",
        "when": "editorTextFocus && !findInputFocussed && !python.datascience.ownsSelection && !replaceInputFocussed && editorLangId == 'python'"
    }
]

我认为这是一个离题的话题。这是关于编辑器功能的,它与编程的关系甚至不如导入库的问题。如果您使用的是conda,那么这是一个在最新的point版本中修复的bug。
// Place your key bindings in this file to override the defaultsauto[]
[
    {
        "key": "shift+enter",
        "command": "python.datascience.runFileInteractive"
    },
    {
        "key": "shift+enter",
        "command": "-python.datascience.runcurrentcelladvance",
        "when": "editorTextFocus && python.datascience.featureenabled && python.datascience.hascodecells && !editorHasSelection"
    },
    {
        "key": "alt+enter",
        "command": "python.datascience.execSelectionInteractive",
        "when": "editorTextFocus && python.datascience.featureenabled && python.datascience.ownsSelection && !findInputFocussed && !replaceInputFocussed && editorLangId == 'python'"
    },
    {
        "key": "shift+enter",
        "command": "-python.datascience.execSelectionInteractive",
        "when": "editorTextFocus && python.datascience.featureenabled && python.datascience.ownsSelection && !findInputFocussed && !replaceInputFocussed && editorLangId == 'python'"
    },
    {
        "key": "shift+enter",
        "command": "-python.execSelectionInTerminal",
        "when": "editorTextFocus && !findInputFocussed && !python.datascience.ownsSelection && !replaceInputFocussed && editorLangId == 'python'"
    }
]