上一页 1 2 3 4 5 6 7 8 9 10 ··· 17 下一页
摘要: from docx import Document from docx.shared import Pt,Inches #Pt指镑(int类型),Inches指英寸(float类型) w=Document(r'D:\word练习\练习.docx') for paragraph in w.paragr 阅读全文
posted @ 2020-07-08 22:15 马蹄哒哒 阅读(205) 评论(0) 推荐(0)
摘要: from docx import Document w=Document(r'D:\word练习\练习.docx') for paragraph in w.paragraphs: if paragraph.style.name=='Normal': paragraph.paragraph_forma 阅读全文
posted @ 2020-07-08 13:02 马蹄哒哒 阅读(283) 评论(0) 推荐(0)
摘要: from docx import Document from docx.shared import Pt,RGBColor from docx.oxml.ns import qn w=Document(r'D:\word练习\练习.docx') for paragraph in w.paragrap 阅读全文
posted @ 2020-07-07 15:13 马蹄哒哒 阅读(391) 评论(0) 推荐(0)
摘要: from docx import Document from docx.oxml.ns import qn #中文字体 w=Document() table=w.add_table(3,3,style='Medium Grid 1 Accent 1') table_head=table.rows[0 阅读全文
posted @ 2020-07-06 18:29 马蹄哒哒 阅读(1787) 评论(0) 推荐(0)
摘要: from docx import Document from docx.enum.style import WD_STYLE_TYPE w=Document() styles=w.styles #生成所有的样式表 for style in styles: if style.type==WD_STYL 阅读全文
posted @ 2020-07-06 18:15 马蹄哒哒 阅读(166) 评论(0) 推荐(0)
摘要: from docx import Document from docx.enum.table import WD_CELL_VERTICAL_ALIGNMENT from docx.enum.text import WD_PARAGRAPH_ALIGNMENT w=Document(r'D:\wor 阅读全文
posted @ 2020-07-06 17:54 马蹄哒哒 阅读(209) 评论(0) 推荐(0)
摘要: from docx import Document from docx.shared import Cm from docx.enum.table import WD_TABLE_ALIGNMENT #设置表格对齐方式 w=Document(r'D:\word练习\练习.docx') table=w 阅读全文
posted @ 2020-07-06 16:52 马蹄哒哒 阅读(611) 评论(0) 推荐(0)
摘要: from docx import Document word=Document(r' ') tale=word.tables[0] #第一种删除单元格的方法 table.cell(0,0).text="" #第二种删除单元格的方法 paragraph=table.cell(0,1).paragrap 阅读全文
posted @ 2020-07-05 22:02 马蹄哒哒 阅读(247) 评论(0) 推荐(0)
摘要: import pandas from docx import Document excel=pandas.read_excel(r'F:\word练习\数据.xlsx',header=None) 文件=Document(r'F:\word练习\a.docx') 表=文件.add_table(4,4) 阅读全文
posted @ 2020-07-04 23:15 马蹄哒哒 阅读(694) 评论(0) 推荐(0)
摘要: from docx import Document from docx import WD_PARAGRAPH_ALIGNMENT w=Documeent(r'F:\word练习\a.docx') #第一种方法 t=w.add_table(3,3) t.cell(0,0).text='李先生' #第 阅读全文
posted @ 2020-07-04 23:02 马蹄哒哒 阅读(317) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 9 10 ··· 17 下一页