摘要:
# 安装 pip install pypdf2 import os from PyPDF2 import PdfFileReader, PdfFileWriter dir_name = '分割后PDF文件' if not os.path.exists(dir_name): os.mkdir(dir_ 阅读全文
摘要:
# 安装 pip install pdfplumber import pdfplumber # 利用pdfplumber提取文字 with pdfplumber.open('基于python的网页爬虫.pdf') as pdf: first_page = pdf.pages[0] print(fir 阅读全文
摘要:
from pptx import Presentation from pptx.util import Cm, Pt from pptx.enum.text import MSO_VERTICAL_ANCHOR, PP_PARAGRAPH_ALIGNMENT from pptx.dml.color 阅读全文
摘要:
# 安装 pip install python-pptx from pptx import Presentation from pptx.util import Cm, Pt # 打开ppt prs = Presentation('测试.pptx') # 获取slide幻灯片 for slide i 阅读全文
摘要:
from docx import Document from docx.enum.text import WD_PARAGRAPH_ALIGNMENT from docx.shared import Pt, RGBColor from docx.oxml.ns import qn doc = Doc 阅读全文
摘要:
''' # 安装 pip install python-docx Document: 文档 Paragraph: 段落 Run: 文字块 ''' from docx import Document from docx.shared import Cm # 打开word文档 doc = Documen 阅读全文