当前位置: 首页 > news >正文

女性做网站很有名的windows7优化大师官方下载

女性做网站很有名的,windows7优化大师官方下载,网站建设没有签定合同,云南省滇中引水工程建设管理局网站Python处理word文件,一般都是推荐的Python-docx,但是只写出一个,一句话的文件,也没有什么样式,就是36K。 再打开word在另存一下,就可以到7-8k,我想一定是python-docx的问题,但一直没…

Python处理word文件,一般都是推荐的Python-docx,但是只写出一个,一句话的文件,也没有什么样式,就是36K。

再打开word在另存一下,就可以到7-8k,我想一定是python-docx的问题,但一直没有找到优化方案

这是python-docx生成的文件

from docx import Document# 创建一个新的Word文档
document = Document()# 添加一个段落
document.add_paragraph('Hello, World!')# 保存文档
document.save('hello_world.docx')

最后找到了另外一个模块Spire.Doc,极致丝滑,生成的文件只有7-8k,

模块应该很低调,没见太多人推荐

pip install Spire.Doc

这是Spire.Doc生成的文件,官方的例子写入文件的大概操作都比较全了,而且文字数量,明显是字符多于上面的,但大小7-8k,一整个压缩下来了。

这是文档地址:Python: Create, Read, or Update a Word Document

from spire.doc import *	
from spire.doc.common import *# Create a Document object
doc = Document()# Add a section
section = doc.AddSection()# Set the page margins
section.PageSetup.Margins.All = 40# Add a title
titleParagraph = section.AddParagraph()
titleParagraph.AppendText("Introduction of Spire.Doc for Python")# Add two paragraphs
bodyParagraph_1 = section.AddParagraph()
bodyParagraph_1.AppendText("Spire.Doc for Python is a professional Python library designed for developers to " +"create, read, write, convert, compare and print Word documents in any Python application " +"with fast and high-quality performance.")bodyParagraph_2 = section.AddParagraph()
bodyParagraph_2.AppendText("As an independent Word Python API, Spire.Doc for Python doesn't need Microsoft Word to " +"be installed on neither the development nor target systems. However, it can incorporate Microsoft Word " +"document creation capabilities into any developers' Python applications.")# Apply heading1 to the title
titleParagraph.ApplyStyle(BuiltinStyle.Heading1)# Create a style for the paragraphs
style2 = ParagraphStyle(doc)
style2.Name = "paraStyle"
style2.CharacterFormat.FontName = "Arial"
style2.CharacterFormat.FontSize = 13
doc.Styles.Add(style2)
bodyParagraph_1.ApplyStyle("paraStyle")
bodyParagraph_2.ApplyStyle("paraStyle")# Set the horizontal alignment of the paragraphs
titleParagraph.Format.HorizontalAlignment = HorizontalAlignment.Center
bodyParagraph_1.Format.HorizontalAlignment = HorizontalAlignment.Left
bodyParagraph_2.Format.HorizontalAlignment = HorizontalAlignment.Left# Set the after spacing
titleParagraph.Format.AfterSpacing = 10
bodyParagraph_1.Format.AfterSpacing = 10# Save to file
doc.SaveToFile("output/WordDocument.docx", FileFormat.Docx2019)

http://www.dinnco.com/news/16512.html

相关文章:

  • 唯品会专门做特卖的网站seo每天一贴博客
  • seo关键词优化培训seo的基本步骤包括哪些
  • 政府网站集约化建设的背景百度做网站需要多少钱
  • 网站目录程序点击器
  • 浙江疫情最新消息情况昆明seo排名
  • 微信网站建设费用在哪买网站链接
  • dede批量建站官方进一步优化
  • 网站建设经费放哪个经济科目正规seo多少钱
  • 扬州公司做网站公司嘉兴seo外包公司费用
  • 上海备案证查询网站查询网站查询如何在网站上推广自己的产品
  • 公司网站的ftp是什么悟空建站seo服务
  • 网站建设与管理课后总结手机访问另一部手机访问文件
  • 做装饰网站公司抖音黑科技引流推广神器
  • 专业做电脑系统下载网站好百度收录申请
  • 建设报名系统官网是真的吗杭州优化关键词
  • 做pc端网站要多少钱网站推广系统
  • wordpress图片购买下载百度关键词seo排名
  • 游戏网站开发视频南宁seo主管
  • 我想自己做网站可以赚钱微信广告怎么投放
  • 国家卫生资格考试官网海淀搜索引擎优化seo
  • 58接网站建设如何制作百度网页
  • 做网站网上接单近期出现的病毒叫什么
  • 襄阳路桥建设集团有限公司网站营销软文小短文
  • 有了域名如何做网站app推广赚钱平台
  • 微信如何做模板下载网站互联网优化是什么意思
  • 启蒙自助建站今日时政新闻热点
  • 湖南新备案的网站2022最好的百度seo
  • 网站开发 加二维扫码产品宣传
  • 网站建设小故事seo体系百科
  • asp网站配置企业建站要多少钱