VS Code 中的Python环境搭建

一、python环境搭建

1、安装微软为VS Code制作的python环境插件。安装方式:点击VS Code左边菜单图标,进入插件筛选界面,直接输入python ,选择发布者为Microsoft的python插件安装。如图1

VS Code 中的Python环境搭建_第1张图片

(图1)

2、python编译环境配置

{
"version": "0.1.0", #
"command": "python", #
"isShellCommand": true,
"args": [ "${file}"],
"showOutput": "always",
"options": {
"env":{
"PYTHONIOENCODING": "UTF-8" #因为windows默认的汉字编码为GBK,而VS Code 的编码是UTF-8。
                                           #在窗口输出中文字符,会出现乱码。通过这句话,设置输出的编码格式。
}
}
}

你可能感兴趣的:(VS Code 中的Python环境搭建)