Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
simple beginner openpyxl example
#!/usr/bin/env python3
import openpyxl
from openpyxl import Workbook
#############################################
# MAIN
#############################################
if __name__ == '__main__':
wb = Workbook()
# grab the active worksheet
ws_01 = wb.active
#Set the title of the worksheet
ws_01.title = "First Sheet"
#place a few values in
ws_01['A1'] = 1
ws_01['B2'] = 2
ws_01['C3'] = 3
#Save it in an Excel fie
wb.save("test_01.xlsx")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.