错误原因:

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

解决方法:

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

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

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

  SyntaxError: inconsistent dedent

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

 

相关文章:

  • 2021-07-12
  • 2022-12-23
  • 2022-12-23
  • 2021-03-30
  • 2021-10-05
  • 2021-10-18
猜你喜欢
  • 2021-08-06
  • 2022-01-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-10
  • 2021-10-15
相关资源
相似解决方案