K
K
Kotorkovsciy2022-03-19 23:15:07
Python
Kotorkovsciy, 2022-03-19 23:15:07

How to get the contents of a specific row in an excel table in python using openpyxl?

A recording has been made

fn = 'table.xlsx'
wb = openpyxl.load_workbook(fn)
ws = wb['data']
ws.append(['a', 'b'])
ws.append(['c', 'd'])
wb.save(fn)
wb.close

You need to display the contents of line 2

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
PavelMos, 2022-03-19
@Kotorkovsciy

wb = load_workbook('table.xlsx')
ws=wb['data']
row2=ws[2]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question