好久没更新了, 主要是懒, 以后尽量坚持定期更新吧, 一周一更, 也算是对自己的激励与要求.
背景
最近整理ICPR2018大会的论文, 发现论文名称都是数字编号, 而且都在一个文件夹里, 这看着头都大了, 想找一片感兴趣的文章要打开, 看标题, 如果不感兴趣, 还要接着重复打开, 关闭. 麻烦. 于是查资料, 学习并捣鼓些小脚本, 用于读取PDF信息和归类.
环境
python3.5.2
需要安装: PyPDF2
sudo pip install PyPDF2
读取PDF中的标题信息(复制操作)
import os
from PyPDF2 import PdfFileWriter, PdfFileReader
from shutil import copy2
src_dir = 'papers_oldDir' #源文件目录地址
des_dir = 'papers_newDir' #新文件目录地址
num = 0
if not os.path.exists(des_dir): #如果没有目标文件夹,新建一个目标文件夹进行存储
os.makedirs(des_dir)
if os.path.exists(src_dir):
dirs =