【发布时间】:2016-02-22 14:11:26
【问题描述】:
如何使用带有python的无头树莓派获取gmail的未读消息数?
我用过
from __future__ import print_function
import httplib2
import os
from apiclient import discovery
import oauth2client
from oauth2client import client
from oauth2client import tools
try:
import argparse
flags = argparse.ArgumentParser(parents=[tools.argparser]).parse_args()
except ImportError:
flags = None
# If modifying these scopes, delete your previously saved credentials
# at ~/.credentials/gmail-python-quickstart.json
SCOPES = 'https://www.googleapis.com/auth/gmail.readonly'
CLIENT_SECRET_FILE = 'client_secret.json'
APPLICATION_NAME = 'Gmail API Python Quickstart'
def get_credentials()....
【问题讨论】:
-
我没有看到任何尝试在您发布的代码中使用 API。
标签: python gmail raspberry-pi