这是一个创建于 2644 天前的主题,其中的信息可能已经有所发展或是发生改变。
#%%
def splist(l,s):
lst = []
lst =[l[i:i+s] for i in range(len(l)) if i%s == 0]
return lst
#%%
def hansu (i,tokenlst):
dict03 = {}
for token in splist(tokenlst,1800)[i] :
try:
url02 = '''http://xxxxxx?token=%s&type=app_application'''%token
resq = json.loads(requests.get(url02).text)['obj']
df02 = pd.DataFrame(resq)
dict03[token] = {'APP 个数':len(df02)}
df05 = pd.DataFrame(dict03).T
df05.to_excel('D:/维度 0716/APP 个数.xlsx')
except:
continue
return df05
threads = []
for j in range(len(splist(tokenlst,1800))):
t = threading.Thread(target=hansu,args=(j,tokenlst))
threads.append(t)
t.start()
for t in threads:
t.join()