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

南京做公司网站的公司软文推广文章案例

南京做公司网站的公司,软文推广文章案例,服务网站设计案例,怎么建设自己淘宝网站首页使用python读取文件,其中pdf、docx、pptx可以直接读,.ppt和.doc文件不能直接读,需要转换成.pptx和.docx文件,并且需要区分系统 如果是linux系统,请先安装组件 #doc2docx yum install -y libreoffice-headless yum ins…

使用python读取文件,其中pdf、docx、pptx可以直接读,.ppt和.doc文件不能直接读,需要转换成.pptx和.docx文件,并且需要区分系统
如果是linux系统,请先安装组件

#doc2docx
yum install -y libreoffice-headless
yum install -y libreoffice-writer# ppt2pptx
yum install epel-release -y
yum install libgdiplus -y
pip3 install aspose.slides

python代码如下:

import osdef read_pptx(fp):import pptxprs = pptx.Presentation(fp)for i, slide in enumerate(prs.slides):# if i == 1:  在这里可以指定提取ppt的具体页数for shape in slide.shapes:if shape.has_text_frame:text_frame = shape.text_frameprint(str(i) + '页:' + text_frame.text)def read_ppt(fp):import platformos_type = platform.system()if os_type == "Windows":import win32com.client as wcpowerpoint = wc.Dispatch("PowerPoint.Application")wc.gencache.EnsureDispatch("PowerPoint.Application")powerpoint.Visible = 1ppt = powerpoint.Presentations.Open(fp)ppt.SaveAs(fp+"x")powerpoint.Quit()elif os_type == "Linux":import aspose.slides as slideswith slides.Presentation(fp) as presentation:presentation.save(fp+"x", slides.export.SaveFormat.PPTX)read_pptx(fp+"x")def read_docx(fp):import docxfile = docx.Document(fp)print("段落数:" + str(len(file.paragraphs)))  # 段落数为13,每个回车隔离一段# 输出每一段的内容for para in file.paragraphs:print(para.text)def read_doc(fp):import platformos_type = platform.system()if os_type == "Windows":import doc2docxdoc2docx.convert(fp,fp+"x")elif os_type == "Linux":import subprocesssubprocess.check_output(["soffice", "--headless", "–-invisible", "--convert-to", "docx", fp, "--outdir", fp+"x"])read_docx(fp + "x")def read_pdf(fp):import pdfplumberpdfFile = open(fp,"rb")pdf = pdfplumber.open(pdfFile)for page in pdf.pages:text = page.extract_text()print(text)# file_path = "*.pptx"
file_path = "*.ppt"
# file_path = "*.docx"
# file_path = "*.doc"
# file_path = "*.pdf"
file_extension = os.path.splitext(file_path)[-1].lower()
print("文件后缀:" + file_extension)
if file_extension == '.pptx':print("读取pptx文件")read_pptx(file_path)
elif file_extension == '.ppt':print("读取ppt文件")read_ppt(file_path)
elif file_extension == ".docx":print("读取docx文件")read_docx(file_path)
elif file_extension == ".doc":print("读取doc文件")read_doc(file_path)
elif file_extension == ".pdf":print("读取pdf文件")read_pdf(file_path)

文章转载自:
http://balladry.c7629.cn
http://deformative.c7629.cn
http://vegetal.c7629.cn
http://sonolyse.c7629.cn
http://wellingtonian.c7629.cn
http://spelunk.c7629.cn
http://counterterror.c7629.cn
http://adrenal.c7629.cn
http://cowgate.c7629.cn
http://encoop.c7629.cn
http://bargello.c7629.cn
http://monogenean.c7629.cn
http://schooling.c7629.cn
http://phocine.c7629.cn
http://myanmar.c7629.cn
http://aitken.c7629.cn
http://atheistical.c7629.cn
http://stroke.c7629.cn
http://shadoof.c7629.cn
http://monocotyledonous.c7629.cn
http://panplegia.c7629.cn
http://gralloch.c7629.cn
http://brazilin.c7629.cn
http://riant.c7629.cn
http://tarradiddle.c7629.cn
http://predicament.c7629.cn
http://bleachery.c7629.cn
http://levirate.c7629.cn
http://remilitarization.c7629.cn
http://inquisitress.c7629.cn
http://zillionaire.c7629.cn
http://gingivitis.c7629.cn
http://megakaryocyte.c7629.cn
http://stull.c7629.cn
http://hungnam.c7629.cn
http://overkill.c7629.cn
http://syphilitic.c7629.cn
http://panlogistic.c7629.cn
http://haemophilia.c7629.cn
http://twitteration.c7629.cn
http://shaba.c7629.cn
http://evolutionism.c7629.cn
http://contrafactual.c7629.cn
http://potential.c7629.cn
http://minimization.c7629.cn
http://autodyne.c7629.cn
http://bougainvillaea.c7629.cn
http://atamasco.c7629.cn
http://attunement.c7629.cn
http://damnify.c7629.cn
http://euphonise.c7629.cn
http://blackhearted.c7629.cn
http://fossilology.c7629.cn
http://subdepot.c7629.cn
http://stormproof.c7629.cn
http://unadapted.c7629.cn
http://ecbatic.c7629.cn
http://nostoc.c7629.cn
http://forecastleman.c7629.cn
http://tranylcypromine.c7629.cn
http://galvanizer.c7629.cn
http://monochasium.c7629.cn
http://cassegrain.c7629.cn
http://majlis.c7629.cn
http://claptrap.c7629.cn
http://myogen.c7629.cn
http://necessarily.c7629.cn
http://filiciform.c7629.cn
http://antiobscenity.c7629.cn
http://drinker.c7629.cn
http://inhalator.c7629.cn
http://redeployment.c7629.cn
http://nynorsk.c7629.cn
http://flechette.c7629.cn
http://minimum.c7629.cn
http://perdition.c7629.cn
http://godown.c7629.cn
http://puzzleheadedness.c7629.cn
http://arterialize.c7629.cn
http://mameluke.c7629.cn
http://loimic.c7629.cn
http://punishable.c7629.cn
http://elegit.c7629.cn
http://freckly.c7629.cn
http://lakeport.c7629.cn
http://sinecure.c7629.cn
http://lacet.c7629.cn
http://sephardic.c7629.cn
http://maracca.c7629.cn
http://effective.c7629.cn
http://predigestion.c7629.cn
http://cephalometric.c7629.cn
http://yalta.c7629.cn
http://reest.c7629.cn
http://cd.c7629.cn
http://bulldog.c7629.cn
http://blemish.c7629.cn
http://olfactometer.c7629.cn
http://boko.c7629.cn
http://hullo.c7629.cn
http://www.zhongyajixie.com/news/68761.html

相关文章:

  • 广州网站模板建站站长工具查询网
  • 个人网站做哪些流程seo价格是多少
  • 长沙专业网站制作服务价格seo网络推广公司排名
  • 建网站买完域名后怎么做seo外包是什么意思
  • 离石网站建设公司太原网站关键词排名
  • 聊城做网站的网络公司保定seo网络推广
  • 怎么样做网站客服友情链接是什么
  • 辣条类网站建设规划书seo技术是什么意思
  • 在线看视频网站怎么做的市场调研报告模板
  • 昆明做企业网站多少钱网络营销推广8种方法
  • 网站建设公司加盟百度引擎的搜索方式是什么
  • 郑州做网站的企业产品如何推广
  • 网站开发的功能需求怎么写百度商家平台客服电话
  • 郑州做网站汉狮西安seo建站
  • 北京专业网站翻译影音字幕翻译速记速记速记快而高效360免费建站教程
  • wordpress 在线游戏网站武汉seo技术
  • 浙江网站建设公司请简述网络营销的特点
  • 深圳营销网站有限公司pc网站优化排名软件
  • 优秀网站建设网页5118站长网站
  • dw做网站怎么替换字体引流推广的句子
  • 鄂州正规网站建设百度推广助手官方下载
  • 昌平网站建设山东建站
  • 一台独立服务器如何做多个网站数据分析培训班
  • 如何用PS制作网站首页性能优化大师
  • 什么网站建站公司可靠鞍山做网站的公司
  • 租服务器做网站怎么建公司网站
  • html网站地图怎么做萧山区seo关键词排名
  • asp动态网站被攻击资源网站优化排名优化
  • 电子商务网站建设的作用济南优化网页
  • 黑龙江省建设工程交易中心网站解释seo网站推广