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)
Jusqu'à 3.4 pour spécifier dox avec pip install Après cela, spécifiez le nom du package avec 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