Gavin Burris
Gavin Burris

Reputation: 11

Python formatting error

What is the issue? I tried looking for tabs, but I see none.


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())

Upvotes: 0

Views: 61

Answers (1)

Assem
Assem

Reputation: 12097

Indentation of the doc-string should be the same as the next lines:

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

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

More about indenting code.

Upvotes: 1

Related Questions