You can write to Excel from python
xlsxwriter
# -*- coding: utf-8 -*-
import xlsxwriter
#Create an Excel file and add a sheet
workbook = xlsxwriter.Workbook('demo.xlsx')
worksheet = workbook.add_worksheet()
#Specify column width
worksheet.set_column('A:A', 20)
#Formatting (make it bold)
bold = workbook.add_format({'bold': True})
#Hello write to A1
worksheet.write('A1', 'Hello')
#Write World in bold on A2
worksheet.write('A2', 'World', bold)
#Write by specifying the matrix with numbers
worksheet.write(2, 0, 123)
worksheet.write(3, 0, 123.456)
#Image insertion
worksheet.insert_image('B5', 'imoyokan.jpg')
#Excel close
workbook.close()
Recommended Posts