pycharm pep8規範 個人問題總結

2021-10-09 09:19:09 字數 715 閱讀 4949

e302 expected 2 blank lines, found 1

函式前要有兩行空

e231 missing whitespace after 『,』

, : 後面都要有空格

e225 missing whitespace around operator

= 、 ,之類的賦號周圍要有空格

pep 8: e262 inline comment should start with '# '

注釋要以# 開始(#空格)

pep 8: e261 at least two spaces before inline comment

注釋前應該兩個空格,所以應該是

print() # 注釋

shadows name 『reslut』 from outer scope

外部已經定義了這個名字的變數,外部的沒用了

remove redundant parentheses

刪除所在**行最外層括號。我這次是 if 中條件不用加括號

pep 8: w292 no newline at end of file

檔案末尾回車

個人 編碼規範

一 變數命名 int i為字首 int arr為字首 int pi為字首 unsigend int ui為字首 unsigend int pui為字首 short s為字首 short ps為字首 unsigend short us為字首 unsigend short pus為字首 long l為字...

HTML規範 個人總結

所有書寫均在英文半形狀態下的小寫 所有標籤必須閉合 統一用tab鍵縮排 屬性值必須帶引號 單引或雙引 ul,li ol,li dl,dt,dd擁有父子級關係的標籤,下一級只能巢狀對應的列表項子級 p,dt,h標籤 裡面不能巢狀塊屬性標籤 a標籤不能巢狀a 內聯元素不能巢狀塊 a除外 對 之類的特殊符...

個人程式命名規範

函式命名參考 google 命名規範,但是由於自己的專案實際存在其他的庫以及其他的程式,所以不能完全依賴,以及存在一些個人的命名習慣,所以僅供參考 檔名一般是類名,部分是 單詞的組合,有三種格式 一般來說,同名檔案存在 cpp 和 h 兩種對應格式,相應的 cpp cc 存放在code src資料夾...