wanlifeipeng

  博客园 :: 首页 :: 博问 :: 闪存 :: :: 联系 :: 订阅 订阅 :: 管理 ::
from collections import  OrderedDict

import xlwt

with open('student.txt','r') as f:
    number_list = json.load(f,object_pairs_hook=OrderedDict)
wb = xlwt.Workbook()
ws = wb.add_sheet('number')
for row,number_arr in enumerate(number_list):
    for col,number in enumerate(number_arr):
        ws.write(row,col,number)
wb.save('number.xls')

 

posted on 2017-04-08 14:38  wanlifeipeng  阅读(723)  评论(0编辑  收藏  举报