Skip to main content
 首页 » 编程设计

Visual Studio 代码上的 Python 3

2025年05月04日12zdz8207

所以我一直在网上寻找如何在 visual studio code 上使用 python 3 编译我的 python 程序。但是,似乎他们没有太多关于如何做的信息。下面是我的 task.json 文件的样子。我在做什么吗?

{ 
// See https://go.microsoft.com/fwlink/?LinkId=733558 
// for the documentation about the tasks.json format 
"version": "0.1.0", 
"command": "Python", 
"isShellCommand": true, 
"args": ["${file}"], 
"showOutput": "always" 
} 

任何建议都会很好,谢谢

请您参考如下方法:

在 VSCode 中,您需要指定要使用特定 Python 版本运行的工作区。

按“Ctrl+Shift+P”并输入“Interpreter”并选择“Python: Select Workspace Interpreter”

这将列出您机器上安装的不同版本。选择你想要的。