SyntaxError: inconsistent dedent

错误原因:

  一般是拷贝别人的代码过来编辑,由于编辑器不同,出现 tab和 space 的差别。

解决方法:

  Window->Preferences->PyDev->Editor->Tabs

  一般eclipse中会默认把 Replace tabs with spaces when typing 勾上。

  如果出现SyntaxError: inconsistent dedent这个错误,就把这个选项去掉试试。

  

  其他的编辑器,同样的原理。

 

posted @ 2017-05-17 14:05  那一剑的風情  阅读(754)  评论(0编辑  收藏  举报