Python中的缩进错误 [英] Indentation Error in Python
本文介绍了Python中的缩进错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
对不起,我无法编译,因为在这部分代码:
Sorry, I can't compile because in this part of code:
if command == 'HOWMANY':
opcodegroupr = "A0"
opcoder = "85"
elif command == 'IDENTIFY':
opcodegroupr = "A0"
opcoder = "81"
我有此错误:
很抱歉:IndentationError:('unindent不符合任何外部缩排层级',('wsn.py',1016,30,\t\telif command =='IDENTIFY':\\\
))
Sorry: IndentationError: ('unindent does not match any outer indentation level', ('wsn.py', 1016, 30, "\t\telif command == 'IDENTIFY':\n"))
但我没有看到任何缩进错误....可能是什么问题?
But I don't see any indentation error.... what can be the problem?
推荐答案
如有疑问,请更改您的编辑器,使标签和空格可见。使用编辑器将所有制表符解析为4个空格也是一个非常好的主意。
In doubt change your editor to make tabs and spaces visible. It is also a very good idea to have the editor resolve all tabs to 4 spaces.
这篇关于Python中的缩进错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文