這是荒謬的,我想不通這是爲什麼不工作...獲取縮進錯誤與Python 3印刷
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 protected]') ## searching based on email
print(len(results))
我得到的錯誤:
$ python quickstart1.py
File "quickstart1.py", line 155
print(len(results))
^
IndentationError: unexpected indent
什麼我做錯了嗎
我建議複製粘貼此代碼,因爲此代碼不會引發該錯誤。 – idjaw
我做了複製/粘貼! –
我的意思是將這個問題中的代碼複製回你的編輯器並運行它。因爲我複製粘貼,我不能重新產生你的問題。 – idjaw