General Process of Using OpenPyXL Package

Three steps:

  • Import the module and create or open a workbook
  • Data analysis and visualization
  • Save and close the workbook

Sample code

import openpyxl as pyxl
wb = pyxl.Workbook()
# Or
from openpyxl import Workbook
wb = Workbook()

ws = wb.create_sheet()
ws["A1"] = 0
ws.append([1, 2, 3])

wb.save('test.xlsx')
wb.close()

Leave a Reply

Your email address will not be published. Required fields are marked *