【问题标题】:Python: IndentationError: unindent does not match any outer indentation levelPython:IndentationError:unindent 不匹配任何外部缩进级别
【发布时间】:2020-08-14 14:15:21
【问题描述】:
import time
import os

while True:
    os.system('ffplay a.mp3 -autoexit -nodisp')
    time.sleep(30)

错误:

File "index.py", line 6
    time.sleep(30)
                 ^
> IndentationError: unindent does not match any outer indentation level

【问题讨论】:

  • 如果你的代码是这样的格式,你不会收到你发布的错误
  • 也许你混合了表格和空格(第 5 行和第 6 行)?

标签: python


【解决方案1】:

不是真的和回答,但我没有足够的代表来评论......

你可以让你的编辑器中的空格可见吗?有时看起来缩进是正确的,但实际上某处有多余的空间。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2010-10-04
    • 1970-01-01
    • 2017-08-12
    相关资源
    最近更新 更多