源起
Python強制縮進,使用Tab鍵和空格都可以,但不能混用。混用Tab和空格會導致報錯:IndentationError: unindent does not match any outer indentation level。如果你的編輯器沒有可視化空格和Tab,修改起來是抓狂的。
配置
Visual Studio Code
{
"editor.tabSize": 4,
"editor.renderWhitespace": true,
"draw_white_space": "all"
}
Sublime Text3
"translate_tabs_to_spaces": true,
"draw_white_space": "all"