# Python Auto formatting on VSCode 1. 首先至開啟 Windows 的 CMD、PowerShell 或者是 windows Terminal,如果是使用 MacBook 則開啟終端機,輸入 ***pip install yapf***,下載 yapf 格式化工具。 如果電腦中已存在 yapf 格式化工具,就會出現類似如下圖內容的訊息。  如果之前沒有下載過,則可能出現類似下圖內容。  2. 首先開啟 VSCode,並找到右下角的設定圖示。  3. 點擊後,選擇 ***Settings*** 選項。  4. 進入 ***Settings*** 畫面後,在上方的搜尋列中,輸入 ***python.formatting.provider***,便會出現可以調整自動排版的工具選項,此處選擇 ***yapf***。  5. 接著清空上方搜尋列,輸入 ***format on save***,並找到對應控制項目,確認確實勾選起來。 
×
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