1. 程式人生 > >在VS Code上搭建Python開發環境

在VS Code上搭建Python開發環境

1、下載安裝 python https://www.python.org/downloads/windows/
web-based installer 線上安裝
executable installer exe安裝
embeddable zip file 內嵌版本
python的安裝步聚可以參考http://jingyan.baidu.com/article/0bc808fc42dfab1bd485b99f.html,注意安裝後配置 path
2、下載安裝VS Code https://code.visualstudio.com/Download
3、在VS Code裡安裝 python 外掛
1)ctrl + shift + p 輸入 ext install 選擇“Extensions:install extension” 回車
這裡寫圖片描述


2) 再輸入 python
3)等待安裝成功
4、在vs code中配置執行python程式的命令
1)ctrl + shift + p 搜尋Configure Task Runner
這裡寫圖片描述
2)開啟tasks.json
修改 Command “tsc” 為 “python”
修改 showOutput “silent” 為 “always”
修改 Arguments [“Helloworld.ts”] 為 [“${file}”]
刪除 最後的一行屬性 problemMatcher
儲存更改
這裡寫圖片描述

3) 使用 ctrl + shift + B 執行py程式檔案