각 열의 값을 인쇄하는 엑셀 시트를 반복하려고합니다. 그런 다음 다음 행으로 이동하여 파일의 끝까지 열 값을 인쇄하십시오. 내가 범위를 벗어 오류 또는 튜플 인덱스를 얻을 파이썬 루프 시트 인쇄 셀 값을 엑셀
Name email desc date
name1 email1 desc1 date1
name2 email2 desc2 date2
name3 email3 desc3 date3
wb = load_workbook('example.xlsx')
sheet = wb.get_sheet_by_name('Sheet1')
row_count = sheet.max_row -1
column_count = sheet.max_column
i = 1
while (i <= row_count):
for item in sheet.iter_cols():
#for row in sheet.iter_cols():
first_value = item[i]
print (first_value.value)
i+=1
처럼
내 데이터 보인다, 또한 올바른 데이터를 인쇄하지 않습니다. 데이터가 동일한 행
[Read Excel File in Python] (https://stackoverflow.com/questions/22169325/read-excel-file-in-python)의 중복 가능 – thatrockbottomprogrammer
** 완전한 * * 코드와 com plete 오류 메시지. – monamona