Python 中的缩进错误 [英] Indentation Error in Python

查看:29
本文介绍了Python 中的缩进错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法编译,因为我的代码中有这部分:

I can't compile because of this part in my code:

if command == 'HOWMANY':
    opcodegroupr = "A0"
    opcoder = "85"
elif command == 'IDENTIFY':
    opcodegroupr = "A0"
    opcoder = "81"

我有这个错误:

Sorry: IndentationError: ('unindent does not match any external indentation level', ('wsn.py', 1016, 30, " elif command == 'IDENTIFY': "))

Sorry: IndentationError: ('unindent does not match any outer indentation level', ('wsn.py', 1016, 30, " elif command == 'IDENTIFY': "))

但我没有看到任何缩进错误.可能是什么问题?

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆