Fork me on GitHub

Visual Studio Code配置 Python 开发环境

Visual Studio Code配置 Python 开发环境

1、安装Python https://www.python.org/


2、安装VSCodehttps://code.visualstudio.com/Download

3、在VSCode上安装Python Ctrl+P 调出控制台,敲ext install Python

4、Ctrl+Shift+P输入task,选中others,新建task.json文件,修改如下:

  1. {  

  2.     // See http://go.microsoft.com/fwlink/?LinkId=733558  

  3.     // for the documentation about the tasks.json format  

  4.     "version""0.1.0",  

  5.     "command""python",  

  6.     "isShellCommand"true,  

  7.     "args": ["${file}"],  

  8.     "showOutput""always"  

  9. }  

如果print输出中文出现乱码可以在配置文件task.json加上下列代码

1
2
3
4
5
"options": {
"env":{
    "PYTHONIOENCODING": "UTF-8"
  }
},


5、Ctrl+shift+B即可自动运行文件


posted @ 2017-02-20 23:51  大道化简  阅读(584)  评论(0)    收藏  举报