提供python3版本的自动化办公常用处理方法
Project description
py3office
提供python3版本的自动化办公常用处理方法
使用
首先需要进行安装:
pip3 install py3office
然后就可以使用了,下面列出所有可用内容:
handler
提供一些辅助方法的模块,比如文件遍历等。
from py3office import handler
printList
打印列表:
handler.printList(list)
listFile
遍历文件夹folder下的所以文件:
handler.listFile(folder, callback)
callback有一个字典类型的参数fileInfo,格式如下:
{
"path": <文件路径> ,
"folder": <当前文件所在文件夹>
}
提供和pdf相关的一些处理方法。
from py3office import pdf
toImage
把pdf转成图片:
pdf.toImage(pdfUrl, targetFolder)
你还可以传递一个函数来自定义图片名称:
# 文件名、内容、页序号、页数
def getName(name, texts, index, total):
return <新的名称>
pdf.toImage(pdfUrl, targetFolder, getName)
版权
MIT License
Copyright (c) zxl20070701 走一步,再走一步
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
py3office-0.1.1.tar.gz
(12.7 kB
view hashes)