python-TabError: inconsistent use of tabs and spaces in indentation

刚开始在vim里面编辑很不习惯,我通常在txt里面写好code,再贴到vim里面(我知道很笨,勿喷)。

今天出现了TabError: inconsistent use of tabs and spaces in indentation,我知道是缩进出问题了,但是仔细检查没=每个缩进都是对齐的呀。查了一番才发现这个错误是因为,我在txt里面使用tab键缩进了,一个tab对应好几个空格,这样就不对了,我把tab全部换成空格缩进就正确了。

猜你喜欢

转载自blog.csdn.net/u012991043/article/details/81531902