Pillow 是一个用于图像处理的 Python 库,是 Python Imaging Library (PIL) 的一个分支和更新版本。它提供了丰富的功能,用于打开、操作和保存多种格式 …
read moreOther articles
使用 FreeSimpleGUI 定制图形界面
使用 python-pptx 库制作PowerPoint
python-pptx 库简介
python-pptx 是一个用于创建和修改 PowerPoint (.pptx) 文件的 Python 库。它提供了丰富的功能,使用户能够方便地生成演示文稿,并且可以进 …
read more使用 Selenium & webdriver 自动化测试
Selenium 是 Python 生态中最强大的工具之一,特别适合处理动态网页和复杂用户交互场景。无论是用于自动化测试、数据抓取、还是 Web …
read more使用 BeautifulSoup & Requests 解析网页
使用 Pandas 实现基本的数据分析
使用 PIL(pillow) 实现图片绘制 & 裁剪 & 水印
使用
PIL代码实现了从图像中裁剪出一个logo,并将其作为水印添加到其他图像上。read moreimport os from PIL import Image from PIL import ImageDraw from pathlib import Path path = "/Users/apple …使用 PyPDF 和 Pandoc 实现word/pdf转换
代码示例展示了如何使用
PyPDF和Pandoc实现word/pdf转换read morefrom pypandoc import convert_file from pathlib import Path from PyPDF2 import PdfReader,PdfWriter unused = ('~', 'demo') def find_doc_files(dir, type="docx"): return [file for file in Path(dir).rglob(f …使用 python-docx 创建 word 文件
代码示例展示了如何使用
python-docx库创建和修改 Word 文件。可运行代码
read morefrom docx import Document from docx.oxml.ns import qn from docx.shared import Inches, Pt, RGBColor template = "demo.docx" name_placeholder = "<name>" sex_placeholder = "<sex …