1. 安装VS Code的Python插件,选择安装次数最多的那个

2. 点击用户设置菜单,在settings.json中添加 "python.pythonPath": "D:/Program Files/Python27/python"

 

新建文件夹,新建 hello.py文件,键入

print ("hello")
print ('你好')

再进行配置,按F1,搜索task,点击configure task runner,在tasks.json文件中,修改两个内容,路径和执行文件名。

"command": "D:/Program File/Python27/python",
"args": ["${file}"],

点击F5, 出来

 VS Code 配置Python

点击最左边的绿色按钮,输出结果:

 

VS Code 配置Python

 

注意:网上说的 shift + ctrl + b 不管用,出来乱码,按F5才行。

 

参考:百度经验

相关文章:

  • 2021-07-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-20
  • 2021-04-19
  • 2021-10-22
  • 2021-08-21
猜你喜欢
  • 2021-04-03
  • 2021-08-24
  • 2021-08-14
  • 2021-09-02
  • 2021-08-21
  • 2021-07-06
相关资源
相似解决方案