<QuerySet [{'name': '文化、科学、教育', 'bor_num': 462, 'book_num': 1},
{'name': '综合性图书', 'bor_num': 425, 'book_num': 6},
{'name': '交通运输', 'bor_num': 251, 'book_num': 1},
{'name': '数理科学和化学', 'bor_num': 230, 'book_num': 3},
{'name': '天文学、地球科学', 'bor_num': 160, 'book_num': 4},
{'name': '经济', 'bor_num': 110, 'book_num': 4},
{'name': '社会科学总论', 'bor_num': 103, 'book_num': 7},
{'name': '历史、地理', 'bor_num': 4, 'book_num': 1},
{'name': '工业技术', 'bor_num': 4, 'book_num': 1},
{'name': '医药、卫生', 'bor_num': 2, 'book_num': 1},
{'name': '环境科学、劳动保护科学(安全科学)', 'bor_num': 2, 'book_num': 1},
{'name': 'IT', 'bor_num': 0, 'book_num': 1}]>
获取列表字典的值
for b in borrow_num:
ws.write(data_row, 0, b["id"])
ws.write(data_row, 1, b["name"])
ws.write(data_row, 2, b["bor_num"])
ws.write(data_row, 3, b["book_num"])
即可在excel里写入正确数据