[英]How do I open the interactive shell/REPL in Visual Studio Code 1.44.2?
I'm using Visual Studio Code, and I'd like to have a REPL that I can run single Python instructions in. I've found some year-old Microsoft documentation on this that says select the View > Other Windows > Interactive menu item, but there is no Other Windows item in my version of VS Code (1.44.2).我正在使用 Visual Studio Code,我想要一个 REPL,我可以在其中运行单个 Python 指令。我找到了一些年前的 Microsoft 文档,上面写着 select 视图 > 其他 ZAEA23428 交互菜单项9CE3AA9B64068CE3AA9B6406 ,但在我的 VS Code 版本(1.44.2)中没有其他 Windows 项目。
Does VS Code have a REPL feature, or do I have to run python.exe directly from the Terminal pane? VS Code 是否具有 REPL 功能,还是我必须直接从终端窗格运行 python.exe?
You are looking at the wrong documentation.您正在查看错误的文档。 That's for Visual Studio , not Visual Studio Code .这是针对Visual Studio的,而不是针对 Visual Studio Code的。 They are annoyingly similarly named, which can be confusing, but they are two completely different IDEs.它们的名称非常相似,令人讨厌,这可能会令人困惑,但它们是两个完全不同的 IDE。
The correct docs for VS Code is here: VS Code 的正确文档在这里:
https://code.visualstudio.com/docs/languages/python https://code.visualstudio.com/docs/languages/python
There is a section for running Python codes on the Terminal:终端上有一个运行 Python 代码的部分:
https://code.visualstudio.com/docs/languages/python#_run-python-code https://code.visualstudio.com/docs/languages/python#_run-python-code
I don't know about REPL, but you can use the standard Python console.我不了解 REPL,但您可以使用标准的 Python 控制台。
There's also an option to run the entire file.还有一个选项可以运行整个文件。
See the Run Python Code section of the docs for more info.有关更多信息,请参阅文档的运行 Python 代码部分。
enter image description here u can open command pallete and type python:Start REPL在此处输入图像描述您可以打开命令托盘并输入python:Start REPL
this will open REPL这将打开 REPL
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.