openpyxl icon indicating copy to clipboard operation
openpyxl copied to clipboard

How to batch write multi rows and multi columns at one time?

Open flyly0755 opened this issue 8 months ago • 0 comments

wb = Workbook()
ws = wb.active
data_list = [['name', 'age', 'gender'],['xxx', 20, 'M'],['yyy', 22, 'F'], ['zzz', 19, 'M'], ...]
# then how to write this data_list at one time like?
ws.write(start='A0', data=data_list)
# Save the file
wb.save("sample.xlsx")

flyly0755 avatar Jun 28 '24 03:06 flyly0755