Python读写excel

 1 #-*- coding:utf-8 -*-
 2 #__author__ = 'liu-ke'
 3 import xlrd
 4 from xlutils.copy import copy
 5 mybook = xlrd.open_workbook("E:\liu-ke\user.xls")
 6 mysheet = mybook.sheet_by_name("name")
 7 j=mysheet.nrows
 8 b=copy(mybook)
 9 c=b.get_sheet(0)
10 c.write(9,1,"liu-ke")
11 b.save("E:\liu-ke\user.xls")
12 
13 
14 for i in range(1,j):
15     print mysheet.cell(i,0).value

 

你可能感兴趣的:(python读写excel)