1import openpyxl
2
3## initializing the xlsx
4xlsx = openpyxl.Workbook()
5
6## creating an active sheet to enter data
7sheet = xlsx.active
8
9## creating data to append
10data = [
11 [1, 2, 3],
12 [4, 5, 6],
13 [7, 8, 9],
14 [10, 11, 12]
15 ]
16
17## appending row by row to the sheet
18for row in data:
19 ## append method is used to append the data to a cell
20 sheet.append(row)
21
22## saving the xlsx file using 'save' method
23xlsx.save('appending.xlsx')