Created
June 4, 2012 17:42
-
-
Save yosemitebandit/2869767 to your computer and use it in GitHub Desktop.
reading xlsx files in python with openpyxl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ pip install -E ~/conf/virtualenvs/xyuml https://bitbucket.org/ericgazoni/openpyxl/get/1.5.8.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from openpyxl import load_workbook | |
workbook = load_workbook('/tmp/data.xlsx', use_iterators=True) | |
first_sheet = workbook.get_sheet_names()[0] | |
worksheet = workbook.get_sheet_by_name(first_sheet) | |
for row in worksheet.iter_rows(): | |
print row | |
# check out the last row | |
for cell in row: | |
print cell |
I can't able to open an excel sheet with comments. What is the solution for that?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
use_iterators has been changed to read_only=True