import openpyxl as opy
book = opy.Workbook()
sheet1 = book.active
sheet1.title
sheet1.title = 'mysheet_1'
book.save('make_excel.xlsx')
my_made = opy.load_workbook('make_excel.xlsx')
sheet2 = my_made.active
table = my_made[sheet2.title]
table['A1'] = 'How is the weather today'
from openpyxl.styles import Font
table['A1'].font = Font(bold=True,italic=True,size=28)
Up to 3.4 to specify docx with pip install After that, specify the package name with python-docx.
import docx
doc = docx.Document()
doc.add_paragraph('How is the weather today')
doc.add_paragraph()
doc.add_paragraph(today_list)
doc.add_paragraph()
doc.add_picture('pict.png')
doc.save('make_word_today.doc')
Recommended Posts