我的向导是: https://developers.google.com/people/v1/write-people
我的代码:
def main():
"""Shows basic usage of the Google People API
"""
credentials = get_credentials()
http = credentials.authorize(httplib2.Http())
service = discovery.build('people', 'v1', http=http,
discoveryServiceUrl='https://people.googleapis.com/$discovery/rest')
contact2 = service.people().createContact(
body={"names": [{"givenName": "John", "familyName": "Doe"}]}).execute()
contact2()
if __name__ == '__main__':
main()
运行时,我的错误:
^{pr2}$我得到了这个错误。如何有效地创建新联系人?在
问题解决了,虽然我不明白为什么。我可以通过以下方式保存联系人:
你的问题是这条线:
contact2()
service.people().createContact
返回dictionary作为响应,而您正试图调用它。在dictionary对象不是函数。在
相关问题 更多 >
编程相关推荐