sid*_*eem 7 python visual-studio-code
我对 Python 真的很陌生,刚刚开始学习“Sendtex 的 Python 3 基础知识(链接:https : //www.youtube.com/channel/UCfzlCWGWYyIQ0aLC5w48gBQ)”。
但是,我无法获得任何输出。下面是附件截图。
如果我选择 Python,它会进入调试模式。所以,没有任何输出。
我建议查看官方 Visual Studio Code Python 文档和教程。它提供了一些基础知识,以及“官方”方式的运行和调试。
有多种方法可以配置内置启动:
当编辑器窗口聚焦于 python 脚本文件(即通常名为 *.py 的文件)时,您可以使用编辑器窗口右上角的“三角形”图标和下拉菜单来运行或调试。
您可能需要设置一个运行/调试配置才能使用它(见下文),或者它可能会自动引导您创建一个。
输出通常会转到“终端”窗口中的新“Python”终端(Ctrl-`,将其打开)。有关如何更改该行为的信息,请参阅此答案。
Run/Add Configuration,然后按照 VS Code 窗口顶部的提示进行操作。更新图像 (1/2022) - 从“调试”更改为“运行和调试”:

现在,调试窗格左上角的调试配置框应该显示“Python:当前文件”:
Visual Studio Code 会将一个名为 的文件添加到当前工作区或工作文件夹中.vscode/launch.json,并将其打开进行编辑。
小智 5
I think you can get your answer from How to execute Python code from within Visual Studio Code.
There is a much easier way to run Python, and configuration is not needed:
Run Code. The code will run and the output will be shown in the Output Window.If you want to add the Python path, you could go to menu File ? Preference ? Settings, and add the Python path like below:
"code-runner.executorMap":
{
"python": "\"C:\\Program Files\\Python35\\python.exe\""
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
41695 次 |
| 最近记录: |