## 本機安裝 python - **前置步驟(Windows 限定)** - **移除 windows 應用程式執行別名關聯** 設定 > 應用程式與功能 > 應用程式執行別名   移除python.exe的別名 - **第一種安裝:官網下載** - **下載 python** https://www.python.org/downloads/ - **安裝 python**  - **試試看吧** - **一段把電腦關機的程式** ```python import os os.system('shutdown /s') ``` - **第二種安裝:使用 uv(Windows)(教室)** > `uv` 是 Astral 開發的高速 Python/包管理工具,**第一次執行即自動下載官方可攜式 CPython**,無須手動安裝多版本 Python。 * 第一步:到 github 頁面 https://github.com/astral-sh/uv  * 點擊右側 docs.astral.sh/uv ,並找到下圖  * 在終端機輸入 ``` powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" ``` * 就可以載完 uv 的東西 * 再輸入 ``` uv init [你要設的資料夾名稱] ``` * 再從 VScode 開啟 [你要設的資料夾名稱] 並在終端機執行以下程式碼,即可執行在 main.py 中的指令 ``` uv run main.py ``` 可先使用 VScode 開啟電腦中 `chocolate` 檔案進行測試~
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up