from aliyunsdkcore.client import AcsClient from aliyunsdkcore.acs_exception.exceptions import ClientException from aliyunsdkcore.acs_exception.exceptions import ServerException from aliyunsdkcore.auth.credentials import AccessKeyCredential from aliyunsdkcore.auth.credentials import StsTokenCredential from aliyunsdkbssopenapi.request.v20171214.QueryEvaluateListRequest import QueryEvaluateListRequest import json import xlwt
title_list = [i for i in data['Data']['EvaluateList']['Evaluate'][0].keys()] count = 0 for title in title_list: worksheet.write(0, count, label=title) count += 1 row = 1
for PageNumber inrange(1, PageCount + 1): request.set_PageNum(1) request.set_PageSize(300) response = client.do_action_with_exception(request) response = str(response, encoding='utf-8') data = json.loads(response)
for list_item in data['Data']['EvaluateList']['Evaluate']: for title in title_list: column = title_list.index(title) value = list_item.get(title) worksheet.write(row, column, value) row += 1