1. 程式人生 > >Pycharm常見解決辦法

Pycharm常見解決辦法

Pycharm常見解決辦法

錯誤資訊1:(Spellchecker inspection helps locate typos and misspelling in your code, comments and literals, and fix them in one click.)

  • 拼寫檢查有助於查詢程式碼中的拼寫錯誤、註釋和文字,並在一次單擊中修復它們。
  • 解決:ctrl+A+L法/關閉拼寫檢查
    選中單詞 - 右鍵 - spelling - save to project-level dictionary

錯誤資訊2:This inspection detects shadowing names defined in outer scopes.

  • 檢查到波浪處的單詞已在函式外部定義。
  • 解決:使用global關鍵字或nonlocal 關鍵字或改名

錯誤資訊3:Variable in function should be lowercase.

  • 函式中的變數應該是小寫的。
  • 解決:換成小寫,或者更改設定
    File - Settings - Editor - Inspections - Python - PEP 8 naming convention violation - ignored errors中新增N802\N803\N806

需要遵守PEP8規則

快樂待參考

This inspection highlights redundant parentheses in statements

此檢查突出了語句中的冗餘括號。