Python读写excel

时间:2023-03-09 07:12:33
Python读写excel
 #-*- coding:utf-8 -*-
#__author__ = 'liu-ke'
import xlrd
from xlutils.copy import copy
mybook = xlrd.open_workbook("E:\liu-ke\user.xls")
mysheet = mybook.sheet_by_name("name")
j=mysheet.nrows
b=copy(mybook)
c=b.get_sheet(0)
c.write(9,1,"liu-ke")
b.save("E:\liu-ke\user.xls") for i in range(1,j):
print mysheet.cell(i,0).value