2017-03-01 1 views
0

나는 몇 가지 방법을 시도했지만 아래 그림과 같이 내 Excel 파일을 여는 더 좋은 방법을 찾지 못했습니다. enter image description here.xls/excel 파일을 python3.3에서 읽는 방법

다음은 내가 시도한 예 중 하나입니다.
책 = xlrd.open_workbook (경로)
인쇄 (책)

이름 경우 == '주요':
read_open_exls (casemon
가져 오기
데프 read_open_exls (경로) xlrd .xls)

미리 감사드립니다.

답변

0

통합 문서를 인쇄 할 수 있는지 확실하지 않습니다.

먼저 시트를 선택해야합니다. 그 시트에서 값을 읽을 수 있습니다.

from openpyxl import load_workbook 
wb = load_workbook(filename = 'empty_book.xlsx') 
sheet_ranges = wb['range names'] 
print(sheet_ranges['D18'].value) 

https://openpyxl.readthedocs.io/en/default/usage.html