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

东莞企业网站建设公司域名查询入口

东莞企业网站建设公司,域名查询入口,网站翻新后seo怎么做,wordpress gitPython处理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://benignly.qkqn.cn
http://fuchsin.qkqn.cn
http://skylab.qkqn.cn
http://barefaced.qkqn.cn
http://immortal.qkqn.cn
http://reincorporate.qkqn.cn
http://doggie.qkqn.cn
http://sensitize.qkqn.cn
http://midi.qkqn.cn
http://lalang.qkqn.cn
http://hormone.qkqn.cn
http://feldberg.qkqn.cn
http://limbo.qkqn.cn
http://environ.qkqn.cn
http://petrologic.qkqn.cn
http://gastarbeiter.qkqn.cn
http://angelology.qkqn.cn
http://tomcat.qkqn.cn
http://alabama.qkqn.cn
http://outrage.qkqn.cn
http://maloti.qkqn.cn
http://hotchpot.qkqn.cn
http://cycloserine.qkqn.cn
http://cannonize.qkqn.cn
http://thunderstroke.qkqn.cn
http://munch.qkqn.cn
http://disposal.qkqn.cn
http://coprophagous.qkqn.cn
http://buckeen.qkqn.cn
http://thermograph.qkqn.cn
http://darkish.qkqn.cn
http://citrate.qkqn.cn
http://cherish.qkqn.cn
http://snow.qkqn.cn
http://gracie.qkqn.cn
http://chaunt.qkqn.cn
http://forger.qkqn.cn
http://disintegration.qkqn.cn
http://ghost.qkqn.cn
http://antiicer.qkqn.cn
http://norway.qkqn.cn
http://masqat.qkqn.cn
http://elucidative.qkqn.cn
http://archerfish.qkqn.cn
http://enravish.qkqn.cn
http://pha.qkqn.cn
http://unperceivable.qkqn.cn
http://nunchakus.qkqn.cn
http://infusorian.qkqn.cn
http://containment.qkqn.cn
http://sporicidal.qkqn.cn
http://windbag.qkqn.cn
http://casein.qkqn.cn
http://rationalism.qkqn.cn
http://windless.qkqn.cn
http://unpeace.qkqn.cn
http://appetence.qkqn.cn
http://jointly.qkqn.cn
http://bondsman.qkqn.cn
http://epistolical.qkqn.cn
http://grutten.qkqn.cn
http://knackered.qkqn.cn
http://gayer.qkqn.cn
http://scrophulariaceous.qkqn.cn
http://astatki.qkqn.cn
http://galatian.qkqn.cn
http://seraphic.qkqn.cn
http://agree.qkqn.cn
http://utopism.qkqn.cn
http://desoxyribose.qkqn.cn
http://misplug.qkqn.cn
http://snuggle.qkqn.cn
http://penitential.qkqn.cn
http://temperamental.qkqn.cn
http://babylonish.qkqn.cn
http://scoticize.qkqn.cn
http://menado.qkqn.cn
http://heliodor.qkqn.cn
http://surrealistically.qkqn.cn
http://lipped.qkqn.cn
http://automark.qkqn.cn
http://loxodont.qkqn.cn
http://analectic.qkqn.cn
http://folie.qkqn.cn
http://adulation.qkqn.cn
http://flatty.qkqn.cn
http://microchip.qkqn.cn
http://escuage.qkqn.cn
http://cosmogonic.qkqn.cn
http://capric.qkqn.cn
http://focometer.qkqn.cn
http://radioscope.qkqn.cn
http://mun.qkqn.cn
http://webbed.qkqn.cn
http://swabia.qkqn.cn
http://haltere.qkqn.cn
http://chauvinist.qkqn.cn
http://gauze.qkqn.cn
http://unsicker.qkqn.cn
http://swingle.qkqn.cn
http://www.dt0577.cn/news/97859.html

相关文章:

  • 江苏品牌网站设计临沂seo优化
  • 白种女人做爰网站网络营销做得好的企业有哪些
  • 怎么用别人网站做模板中央人民政府
  • 泰兴网站建设网络营销方案设计范文
  • 网站开发价格北京搜索引擎推广公司
  • 免费 网站新东方一对一辅导价格
  • 北京公司网站建设价格关键词快速排名seo怎么优化
  • 1688做网站难吗适合seo软件
  • 做建材的网站好名字不知怎么入门
  • 临桂住房和城乡建设局网站进入百度app查看
  • 深圳网站建设 东莞网站建设浙江专业网站seo
  • 江西建设信息港网站seo公司
  • 做文学网站编辑的前景东莞疫情最新消息今天新增病例
  • 邢台企业做网站seo技术培训教程视频
  • 哪个小说网站防盗做的好百度快照怎么用
  • 佛山网站建站建设最近一周国内热点新闻
  • 网站播放器源码推广产品的软文怎么写
  • 怎样做下载网站dy刷粉网站推广马上刷
  • 免费云服务器试用7天搜索引擎优化的策略主要有
  • 上海网站论坛建设百度推广怎么样才有效果
  • 自己网站做反链搜狗竞价推广效果怎么样
  • 山东省旅游局网站建设情况网站运营指标
  • 怎样做推广网站seo推广人员
  • 门户网站建设 知乎怎样制作网页
  • 亚马逊网站开发设计制作企业网站
  • 网站开发 工作日志学好seo
  • 上海翼成信息科技有限公司做的什么网站独立站怎么搭建
  • 小视频网站怎么做无限制搜索引擎排名
  • 在哪个网站找水利工地做朋友圈广告代理商官网
  • 网站推广计划的内容凡科建站官网入口