本文章適用於 Windows 環境,使用 Visual Studio Code 撰寫 Python 程式。
一、安裝 Vscode:
-
到 Vscode 官網下載 Vscode 的安裝檔。
連結:https://code.visualstudio.com/
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
-
開啟安裝檔,接著只要一直按下一步就能安裝完成,到附加工作這一頁推薦全勾取。
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
-
安裝寫 Python 必備和更便利的擴充功能,先進入到管理擴充功能的地方,點擊最左邊工具列四個框框的圖標或者按下快捷鍵 Ctrl + Shift + X。
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
-
於輸入框中輸入想要安裝的功能名稱,接著按下安裝並重啟 Vscode 即可安裝完畢。
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
二、安裝 Python:
-
到 Python 官網下載 Python 安裝檔,安裝最新版本即可。
連結:https://www.python.org/
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
-
開啟安裝檔,勾選 Add python.exe to PATH,讓 Python 自動加入 Windows 環境變數。
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
-
將電腦重新啟動,讓環境變數生效。
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
三、執行 Vscode 的第一個 Python:
-
使用 Vscode 開啟一個資料夾,新增一個新檔案。
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
-
寫出 Vscode 中的第一個 Python 程式 "Hello, world!" 吧。
print("Hello, world!")
-
如果終端機成功顯示 "Hello, world!" 的話,恭喜接下來就能開心寫 Python 程式囉!
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Copyright © 2022 SmallShawn95. All rights reserved.