首页 > 学院 > 开发设计 > 正文

Python读写excel

2019-11-14 17:16:04
字体:
来源:转载
供稿:网友
 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

 


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表