“inconsistent use of tabs and spaces in indentation”

后端 未结 28 2207
北恋
北恋 2020-11-22 00:56

I\'m trying to create an application in Python 3.2 and I use tabs all the time for indentation, but even the editor changes some of them into spaces and then print out \"inc

28条回答
  •  广开言路
    2020-11-22 01:30

    Sometimes, tab does mess up while indenting. One way is to obviously use the tab and backspace to correctly indent the code.

    Another way is to use space 4 times (depending on how much you want to indent).

    A weird way that worked for me when nothing else worked, whichever line I getting the error, I backspaced that line to the previous line and then pressed enter. It automatically indented the line to correct position and I was not getting any error after that.

    Hopefully, this should help.

提交回复
热议问题