1.安裝
安裝python
2.配置環境變量
path環境變量增加
D:\Python35\Scripts\;D:\Python35\;
測試是否安裝成功,命令行執行python -V
3.安裝
安裝 vs code
安裝插件:
Code Runner
Python
配置
文件—》首選項—》設置,在settings.json中
{
"files.autoGuessEncoding": true, "code-runner.defaultLanguage": "utf-8", "code-runner.runInTerminal":true, "files.encoding": "utf8" }
4.測試
新建文件夾Hello
在Hello下新建.vscode/settings.json
Ctrl+Shift+P
打開命令板,輸入Python: Select Interpreter
進行搜索
選擇python
在Hello下新建hello.py
msg = "hello world" print(msg)
運行,右鍵
結果
E:\python\Hello>python -u "e:\python\Hello\Hello.py"
hello world