Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/sorting/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从google域获取用户的python脚本_Python_Gdata - Fatal编程技术网

从google域获取用户的python脚本

从google域获取用户的python脚本,python,gdata,Python,Gdata,这是一个python脚本,它应该从google域获取用户。。。出于某种原因,我似乎收到了授权标头错误。不知道我错过了什么试着到处寻找但没有成功 下面是整个python脚本 import gdata.apps.service import gdata.apps.groups.service from array import * import simplejson as json consumer_key = '*******' consumer_secret = 'd#######Q' #ch

这是一个python脚本,它应该从google域获取用户。。。出于某种原因,我似乎收到了授权标头错误。不知道我错过了什么试着到处寻找但没有成功

下面是整个python脚本

import gdata.apps.service
import gdata.apps.groups.service
from array import *
import simplejson as json

consumer_key = '*******'
consumer_secret = 'd#######Q' #check advanced / OAuth in you control panel
sig_method = gdata.auth.OAuthSignatureMethod.HMAC_SHA1

service = gdata.apps.service.AppsService(domain=consumer_key)
service.SetOAuthInputParameters(sig_method, consumer_key, consumer_secret=consumer_secret, two_legged_oauth=True)
words=""
myDict = {}


res = service.RetrieveAllUsers()
for entry in res.entry:
    #words.append(entry.login.user_name)
    #myDict[entry.login.user_name] = entry.login.user_name
 words+=str(entry.login.user_name)+","


print words               
我在retrieveallusers()处出错