完美解决TabError: inconsistent use of tabs and spaces in indentation

完美解决TabError: inconsistent use of tabs and spaces in indentation_解决方法


文章目录

  • 报错问题
  • 解决方法
  • 声明


报错问题

之前在工作中遇到过这个坑,记录一下问题以及解决方法,不一定针对所有情况都能用,但是可以供大家参考。
问题描述如下:
TabError: inconsistent use of tabs and spaces in indentation

TabError:缩进中不一致地使用制表符和空格

完美解决TabError: inconsistent use of tabs and spaces in indentation_bug_02

解决方法

完美解决TabError: inconsistent use of tabs and spaces in indentation_快捷键_03

该bug的原因是,各行存在不同的缩进空格,未统一化。只需将出错的代码行及其前边的所有行,全选中,统一还原靠左边,然后再统一执行缩进快捷键即可!

声明

解决方法参考网络,如有侵权联系我删除