IEEE發(fā)布2017年編程語言排行榜:Python高居首位。眾所周知,自動(dòng)去年alpha go在圍棋界大放異彩后,人工智能成為全社會(huì)的熱點(diǎn)話題。而Python作為全球最活躍的人工智能開源庫(kù)tensorflow開源庫(kù)的主要語言之一,自然也成為科研界,工業(yè)界追捧的對(duì)象。
安裝Python
方法一:從Python官網(wǎng)下載Python 3.5的安裝程序(網(wǎng)速慢的同學(xué)請(qǐng)移步國(guó)內(nèi)鏡像),雙擊運(yùn)行并安裝;
方法二:如果安裝了Homebrew,直接通過命令brew install python3
安裝即可。
檢測(cè)Python 是否安裝成功?
檢測(cè)Python是否安裝成功
配置VScode 環(huán)境
創(chuàng)建Python 文件
創(chuàng)建test.py 文件
print("Hello VSCode")
a = 1
b = 2
c = a + b
print(c)
創(chuàng)建task.json 文件
使用快捷鍵command + shift + b, 創(chuàng)建task.json。
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "python",
"isShellCommand": true,
"args": ["test.py"],
"showOutput": "always"
}
執(zhí)行python 文件
通過command + shift + b,自動(dòng)化執(zhí)行python 文件,并在output 欄查看輸出結(jié)果。
查看輸出結(jié)果