Python格式

2024-04-26 14:05:34 发布

您现在位置:Python中文网/ 问答频道 /正文

问题是什么?我试着找标签,但没有看到。你知道吗


File "/home/pi/jasper/client/modules/Wikipedia.py", line 24
  mic.say("Okay, what would you like me to look up?")
                                                    ^
IndentationError: unindent does not match any outer indentation level

            """
            Responds to user-input, typically speech text, by relaying the
            entry from Wikipedia.

            Arguments:
            text -- user-input, typically transcribed speech
            mic -- used to interact with the user (for both input and output)
            profile -- contains information related to the user (e.g., phone
               number)
            """

    mic.say("Okay, what would you like me to look up?")

    def sayDefinition(text):
        mic.say(mic.say(wikipedia.summary(text, sentences=2)))

    sayDefinition(mic.activeListen())

Tags: thetotextyouinputwikipediawhatlike
1条回答
网友
1楼 · 发布于 2024-04-26 14:05:34

文档字符串的缩进应与下一行相同:

    """
    Responds to user-input, typically speech text, by relaying the
    entry from Wikipedia.

    ...
    """
    mic.say("Okay, what would you like me to look up?")

更多关于indenting code。你知道吗

相关问题 更多 >