Created
October 14, 2018 12:43
-
-
Save luiscberrocal/32708c5200fbc638a055f636c48335cc to your computer and use it in GitHub Desktop.
Simple example on how to write to excel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wb = Workbook() | |
sheet = wb.create_sheet() | |
row = 1 | |
col = 1 | |
for header in headers: | |
sheet.cell(row=row, column=col, value=header) | |
col += 1 | |
row += 1 | |
git_lines = self.report(git_format) | |
for line in git_lines: | |
self.stdout.write(line) | |
line_data = line.split('|') | |
col = 1 | |
for data in line_data: | |
sheet.cell(row=row, column=col, value=data) | |
col += 1 | |
row += 1 | |
wb.save(filename) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment