运行python脚本时遇到的报错信息:IndentationError: unindent does not match any outer indentation level

错误信息:IndentationError: unindent does not match any outer indentation level,自己的运行的时候找了很久都找不到为什么报错,因为在编辑器中看不到,那是为什么呢?
原因:缩进量不统一导致(TAB键与四个空格混用),即使Tab键的长度和四个空格一样长,两者一起用依然还是会报错
解决方法:
1)在pycharm中显示空格,在设置中进行设置
2)将代码复制nodepad++中查看空格的使用情况
在这里插入图片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章