Here's an example of how to write a table in an existing Excel file using openpyxl library in Python:
main.py524 chars28 lines
The code above uses openpyxl
to load an existing Excel file and select a worksheet. It then creates a table header row and appends it to the worksheet.
Next, some example data is defined and the rows are also appended to the worksheet. Finally, the changes are saved to the workbook using workbook.save()
.
gistlibby LogSnag