小编Erv*_*van的帖子

类python中的IndentationError

我喜欢这样的代码

# -*- coding: utf-8 -*-

class OP(object):

  def RECEIVE_MESSAGE(self):
      print("done")


  def NOTIFIED_INVITE_INTO_GROUP(self):
    print("done")
Run Code Online (Sandbox Code Playgroud)

但当我运行这个我有一些错误

Traceback (most recent call last):
File "run.py", line 2, in <module>
  from van import ERVAN
File "/home/server/.pub/van.py", line 4, in <module>
  from op import OP
File "/home/server/.pub/op.py", line 9
  def NOTIFIED_INVITE_INTO_GROUP(self):
                                    ^
IndentationError: unindent does not match any outer indentation level
Run Code Online (Sandbox Code Playgroud)

对此有何解决方案?它只有10条线,但我的脑海里浮现

python indentation python-3.x

1
推荐指数
1
解决办法
49
查看次数

标签 统计

indentation ×1

python ×1

python-3.x ×1