1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| import xlwt import json
workbook = xlwt.Workbook(encoding='utf-8') worksheet = workbook.add_sheet('sheet1')
worksheet.write(0, 0, label='备注') worksheet.write(0, 1, label='App包名') worksheet.write(0, 2, label='App签名')
with open('b.json', 'r') as f: data = json.load(f)
val = 1 for list_item in data: for key, value in list_item.items(): if key == "description": worksheet.write(val, 0, value) elif key == "app_pkgname": worksheet.write(val, 1, value) elif key == "app_cer": worksheet.write(val, 2, value) val = val + 1
workbook.save('b-App.xls')
|