Python3打印时出现缩进错误

2024-09-30 22:27:20 发布

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

我搞不懂为什么这不管用,真可笑

def main():
    """Shows basic usage of the Gmail API.

    Creates a Gmail API service object and outputs a list of label names
    of the user's Gmail account.
    """

    credentials = get_credentials()
    http = credentials.authorize(httplib2.Http())
    service = discovery.build('gmail', 'v1', http=http)

    results = ListThreadsMatchingQuery(service, EMAIL_LOGIN, 'email@gmail.com') ## searching based on email
    print(len(results))

我得到一个错误:

$ python quickstart1.py 
  File "quickstart1.py", line 155
    print(len(results))
    ^
IndentationError: unexpected indent

我做错什么了


Tags: ofthepyapihttplenemaildef