Python--报错TabError: inconsistent use of tabs and spaces in indentation

Posted 归子莫

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Python--报错TabError: inconsistent use of tabs and spaces in indentation相关的知识,希望对你有一定的参考价值。

Python--报错TabError: inconsistent use of tabs and spaces in indentation

博客说明

文章所涉及的资料来自互联网整理和个人总结,意在于个人学习和经验汇总,如有什么地方侵权,请联系本人删除,谢谢!

说明

在运行flask框架的时候报错,死活看不出来,看到资料说是由于混用了tab键和4个空格键造成的,只用一个就可以解决这个问题

思路

出现这个问题是由于在网上编辑了python代码,然后在网上的编辑器里面看不出来,找错误着了半天,原来就是字面意思,把代码全选到pycharm里面,发现代码格式全乱,使用快捷键整理代码alt+command+L,问题解决

感谢

万能的网络

以及勤劳的自己

关注公众号: 归子莫,获取更多的资料,还有更长的学习计划

以上是关于Python--报错TabError: inconsistent use of tabs and spaces in indentation的主要内容,如果未能解决你的问题,请参考以下文章

PyCharm出现TabError: inconsistent use of tabs and spaces in indentation最简单实用的解决办法

python错误提示“TabError: inconsistent use of tabs and spaces in indentation”

Python文件运行时报TabError: inconsistent use of tabs and spaces in indentation

python运行错误---TabError: Inconsistent use of tabs and spaces in indentation

Python之TabError: inconsistent use of tabs and spaces in indentation和ModuleNotFoundError:No module na

python报错 TypeError: string indices must be integers