def get_service(api_name, api_version, scope, key_file_location, service_account_email):
credentials = ServiceAccountCredentials.from_p12_keyfile(service_account_email, key_file_location, scopes=scope)
http = credentials.authorize(httplib2.Http())
# Build the Google API service object.
service = build(api_name, api_version, http=http)
return service
评论列表
文章目录