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

营销型网站策划书开发工具是什么意思

营销型网站策划书,开发工具是什么意思,旅游网站开发费用,wordpress 权限设置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.yayakq.cn/news/809247/

相关文章:

  • 网站怎么做营销平面设计工作室创业计划书
  • 建立免费网站 优帮云网站开发如何使用API
  • 网站前置审批查询做兼职翻译的网站
  • 在网站里文本链接怎么做seo自然排名
  • 外汇申报在哪个网站上做铜仁 网站开发
  • 免费网站app源码攸县做网站的
  • 重庆所有做网站的公司排名南京网站建设中企动力
  • 让iis做跳转网站秒收网站
  • 玉石网站建设的定位动漫设计一个月能挣多少钱
  • 北京网站大全珠海网站制作服务
  • 是将解压缩的wordpress文件夹下面的文件上传到网站根目录.网站建设题目以及答案
  • 高校网站建设存在的问题太原网站优化技术
  • 哪里有做网站的素材常州网站推广平台
  • 网站登陆界面模板asp.net网站开发与项目实战
  • 一家只做t恤的网站一个外国人做的破解游戏网站
  • CMS源码就可以做网站吗深圳找网站建设公司哪家好
  • 网站域名建设我的小程序怎么制作
  • 网站权重和什么有关辽宁建设工程信息网官网首页官方
  • 网站建设春节放假word 发布到wordpress
  • 有什么彩票网站做代理好点公众号制作模板免费
  • 技术支持::天空网络-临汾做网站八大装修风格有哪些
  • 国外的调查网站上做问卷企业管理系统需求分析
  • HTML和PHP怎么做网站国外扁平化设计网站
  • 上海城乡住房建设部网站推广网站怎么建
  • 如何做产品网站建设建设网站需要买什么
  • 网站关键词怎么布局大型网络游戏排行榜2021前十名
  • 洛阳网站建设哪家便宜网站建站前seo注意
  • 电子商务网站建设完整详细流程图怎么把店地址申请百度地图
  • react node.js网站开发哈尔滨关键词优化排行
  • 网站怎么做?做易经网站