Python beginners advice indentation problem under VIM

The Linux comes with the python lines of the input is correct, but the same discharge to generate the.Py file under the VIM prompt indentation error, how to change ah? VIM prepared under the content

Started by natascha at December 18, 2016 - 12:11 AM

Python can identify the indented 4 spaces, VIM you may click on TAB, then is \t, not 4 spaces.
You enter the 4 spaces. In addition, VIM seems to click TAB to achieve the 4 spaces, I also do not know the specific methods, please search.

Posted by Kate at December 31, 2016 - 1:04 AM

After the reform.

Posted by natascha at January 02, 2017 - 1:27 AM

I change into 4 spaces, or report the same mistake, seeking to explain

Posted by natascha at January 03, 2017 - 2:19 AM

Python for the use of several spaces for indentation is not mandatory, is recommended for use in the PEP8 4 spaces.
Your code should be no problem, suggest you put out the code file, let everybody see where the problem is.

Posted by Leander at January 04, 2017 - 3:15 AM

I knocked, the error does not mean you indent error, is behind the%thisyear type error, because it is not the str type, so can't print, right?

Posted by Esther at January 13, 2017 - 3:21 AM