Python:讀取xlsx和xls檔案(Excel操作2)
阿新 • • 發佈:2018-12-13
#!/usr/bin/env python # coding:UTF-8 """ @version: python3.x @author:曹新健 @contact: [email protected] @software: PyCharm @file: 2讀取xlsx和xls檔案.py @time: 2018/9/13 17:45 """ ''' pip install openpyxl pip install xlrd pip install future pip install xlwt-future pip install pyexcel-io pip install ordereddict pip install pyexcel pip install pyexcel-xls ''' from collections import OrderedDict from pyexcel_xls import get_data #path = r"C:\Users\曹新健\AppData\Local\Programs\Python\Python36\Scripts\test\備份-溫習\檔案讀寫\Excel讀寫\OPZOON_動態監控測試_ 周總結周計_20180915.XLS" path = r"OPZOON_動態監控測試_ 周總結周計_20180915.xls" dic = get_data(path) for sheet in dic: print(sheet) print(dic,len(dic),sep="\n") print(dic["本週週報"])