import sys import xlrd #from xlrd import open_workbook #import pandas as pd
import xlwt file_path = 'D:\data\\gmy\\文学\\傲慢与偏见.xls' file =
pd.read_html(file_path)#获取.xls工作簿对象 ''' sheet_name =
file.sheet_names()#获取所有工作表名称 print(sheet_name) sheet =
file.sheet_by_index(1)#根据索引获取工作表对象 print(sheet) sheet =
file.sheet_by_name('Sheet1')#根据名称获取工作表对象 print(sheet) print('------------')
rows = sheet.nrows#获取工作表行数 cols = sheet.ncols#获取工作表列数 print(rows) print(cols)
row = sheet.row_values(1)#获取工作表某一行的内容 print(row) cell =
sheet.cell_value(0,1)#获取工作表某一单元格的内容 print(cell) print('\n') ''' def
xls_pro(file, pro_file_com): file = xlrd.open_workbook(file) sheet_names =
file.sheet_names() with open(pro_file_com, 'w', encoding = 'utf-8') as f1: for
sheet_name in sheet_names: sheet = file.sheet_by_name(sheet_name) rows =
sheet.nrows print(rows) #cols = sheet.ncols if rows: for i in range(rows):
cell0 = str(sheet.cell_value(i, 0)) #f1.write(cell0 + '\n') cell1 =
str(sheet.cell_value(i, 1)) f1.write(cell0 + ' ||| ' + cell1 + '\n') file =
'D:\\data\\gmy\\文学\\傲慢与偏见.xls' pro_file_com = "D:\\data\\xls_com.txt"
#pro_file_chn = "D:\\data\\xls_chn.txt" pro = xls_pro(file, pro_file_com)

技术
©2019-2020 Toolsou All rights reserved,
JVM概述VUE+Canvas 实现桌面弹球消砖块小游戏javascript事件(零基础详解)Pikachu漏洞练习平台明解c/c++程序的内存模型--内存四区python实现vlookup_干货一:怎么在python里面实现vlookupswift 5.0 创建一个获取验证码的按钮,实现倒计时效果首期500亿,成立新部门,腾讯准备做什么?关于蓝桥杯大赛,你应该了解的那些事!解决Selenium ActionChains拖动元素无效