当先锋百科网

首页 1 2 3 4 5 6 7
import xlwt
import random
import numpy as np
f = xlwt.Workbook()
sheet1 = f.add_sheet('学生',cell_overwrite_ok=True)
row0 = ["早体温","午体温","晚体温"]
colum0 = list(range(1,69))
list2 = list(np.random.rand(68))
list1 = []
for i in list2:
    i = "%.1f" % i
    list1.append(i)
for i in range(0,len(colum0)):
    sheet1.write(i+1,0,str(36.0+float(list1[i]))+str("℃"))
for i in range(0,len(colum0)):
    sheet1.write(0,i,colum0[i])
f.save('test.xls')