200字范文,内容丰富有趣,生活中的好帮手!
200字范文 > python3 read excel python3读取excel文件(xls/xlsx)

python3 read excel python3读取excel文件(xls/xlsx)

时间:2022-03-08 13:59:00

相关推荐

python3 read excel python3读取excel文件(xls/xlsx)

第一种方法:打开Excel文件,另存为 .csv文件便可,利用读取csv的方式html

第二种方法:python

第一步: pip install pyexcel-xls

环境:python3.6app

工具:pycharm.3 community工具

上代码:.net

# 读取文件excel

# pyexcel_xls 以 OrderedDict 结构处理数据

from collections import OrderedDict

from pyexcel_xls import get_data

from pyexcel_xls import save_data

def read_xls_file():

xls_data = get_data(r"D:\read_test.xlsx")

print ("Get data type:", type(xls_data))

for sheet_n in xls_data.keys():

print (sheet_n, ":", xls_data[sheet_n])

if __name__ == \__main__:

read_xls_file()code

# 写入文件htm

from collections import OrderedDict

from pyexcel_xls import get_data

from pyexcel_xls import save_data

def read_xls_file():

xls_data = get

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。