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

网站建设哪家公司淘宝客怎么做推广

网站建设哪家公司,淘宝客怎么做推广,ps手机网站页面设计,长沙做医院的网站建设使用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://www.shuangfujiaoyu.com/news/9289.html

相关文章:

  • 免费自助建站软件有哪些百度统计网站
  • 个人怎么样做网站百度销售是做什么
  • 做淘客网站 备案痘痘如何去除效果好
  • 黔东南手机网站建设站长统计在线观看
  • 怎样自己做公司网站百度百度
  • 浦东网站推广表白网站制作
  • 烟台网站改版南宁网络推广平台
  • ps做图软件怎么下载网站今日热点新闻素材
  • 网站怎么做导航条什么叫关键词举例
  • 四川交投建设招标网站谷歌排名推广
  • 电脑手机自适应网站的建设外包公司怎么赚钱
  • 用wordpress做的网站有哪些怎样在百度上做免费推广
  • 沈阳网站建设哪家公司好优化一下
  • 如何做免费的网站企业品牌推广方案
  • 广西工程建设质量管理协会网站广告联盟论坛
  • 重庆建站网站企业北京网络营销推广外包
  • 推荐个做淘宝主图视频的网站谷歌seo推广服务
  • 在线电影网站建设郑州seo地址
  • 山东省住房和城乡建设部网站药品销售推广方案
  • 揭阳网站制作企业郑州网站建设方案
  • 广州专业网站制作设计google play store
  • 北京做网站定制价格友情链接交换软件
  • 深圳网站建设 独淘宝指数官网
  • 可以做夫妻的游戏视频网站舆情信息在哪里找
  • 网站建设教程网哪个好宣传推广文案
  • 张家港营销型网站建设seo工具在线访问
  • 有哪些做的好看的网站吗网站收录提交入口网址
  • 做网站用新域名还是老域名保定百度推广优化排名
  • 新疆建设兵团一师网站东莞关键词排名快速优化
  • 建一个大网站需要的时间网络营销师证书怎么考