1 http://download.csdn.net/detail/kernelke/5192910
2 Download File openpyxl-1.6.1.tar.gz
3 Unzip to any path, for example: The path after decompression is C:\openpyxl-1.6.1
4 Installation
Open the Windows window and enter the following:
CD C:\openpyxl-1.6.1
Python setup.py Install
5 Easy to use
Just play it under the shell.
>>> from openpyxl.reader.excel import Load_workbook #包导入
>>> wb = Load_workbook (filename=r ' c:/test.xlsx ') #打开文件
>>> print "Worksheet ranges (s):", Wb.get_named_ranges ()
Worksheet ranges (s): []
>>> print "Worksheet names (s):", Wb.get_sheet_names ()
Worksheet names (s): [' Sheet1 ', ' Sheet2 ', ' Sheet3 ']
>>> sheetnames = Wb.get_sheet_names ()
>>> ws = Wb.get_sheet_by_name (sheetnames[0]) #打开sheet1
>>> for Rx in range (Ws.get_highest_row ()): #对第一个column遍历打印值
Print Ws.cell (row=rx,column=0). Value
An xlsx file in Python that operates in Excel 2000 (using OPENPYXL)