--- title: Visual Studio Code 撰寫 Python 程式 description: 本文章適用於 Windows 環境,使用 Visual Studio Code 撰寫 Python 程式。 langs: zh --- 本文章適用於 Windows 環境,使用 Visual Studio Code 撰寫 Python 程式。 --- [TOC] --- ## 一、安裝 Vscode: 1. 到 Vscode 官網下載 Vscode 的安裝檔。 連結:https://code.visualstudio.com/  2. 開啟安裝檔,接著只要一直按下一步就能安裝完成,到附加工作這一頁推薦全勾取。  3. 安裝寫 Python 必備和更便利的擴充功能,先進入到管理擴充功能的地方,點擊最左邊工具列四個框框的圖標或者按下快捷鍵 Ctrl + Shift + X。  4. 於輸入框中輸入想要安裝的功能名稱,接著按下安裝並重啟 Vscode 即可安裝完畢。  * **Chinese (Traditional) Language Pack for Visual Studio Code** 能將 Vscode 翻譯成繁體中文,對於英文不好的朋友簡直是一大福音。 連結:https://marketplace.visualstudio.com/items?itemName=MS-CEINTL.vscode-language-pack-zh-hant  * **Python** 要寫 Python 程式語言,這是一定要裝的擴充功能。 連結:https://marketplace.visualstudio.com/items?itemName=ms-python.python  ## 二、安裝 Python: 1. 到 Python 官網下載 Python 安裝檔,安裝最新版本即可。 連結:https://www.python.org/  2. 開啟安裝檔,勾選 Add python.exe to PATH,讓 Python 自動加入 Windows 環境變數。  3. 將電腦重新啟動,讓環境變數生效。  ## 三、執行 Vscode 的第一個 Python: 1. 使用 Vscode 開啟一個資料夾,新增一個新檔案。  2. 寫出 Vscode 中的第一個 Python 程式 "Hello, world!" 吧。 ```python= print("Hello, world!") ``` 3. 如果終端機成功顯示 "Hello, world!" 的話,恭喜接下來就能開心寫 Python 程式囉!  --- :::info 📢 歡迎加入我的 Discord 伺服器:https://discord.gg/Jtd3eVrFJs ::: :::info 📢 歡迎加入我的 FB 社團: https://www.facebook.com/groups/shawn20060304/ ::: *Copyright © 2022 SmallShawn95. All rights reserved.*
×
Sign in
Email
Password
Forgot password
or
Sign in via Google
Sign in via Facebook
Sign in via X(Twitter)
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
Continue with a different method
New to HackMD?
Sign up
By signing in, you agree to our
terms of service
.