import docx
doc2=docx.Document()
doc2.add_paragraph('this is on the first page')
#換頁只須要把docx.enum.text.WD_BREAK.PAGE做爲惟一的參數傳遞給add_break
#若是是換行的話就不須要使用docx.enum.text.WD_BREAK.PAGE參數
doc2.paragraphs[0].runs[0].add_break(docx.enum.text.WD_BREAK.PAGE)
doc2.add_paragraph('this is on the seconed page')
doc2.save('example4.docx')this