上一页 1 2 3 4 5 6 7 ··· 17 下一页
摘要: import os import shutil os.chdir(r"E:\自动化办公") 原地址="E:\pdf\文本.txt" 新地址="E:\自动化办公" #要是想改变文件文字可以 "E:\自动化办公\新名字.txt" shutil.copy(原地址,新地址) #copy2完全复制 阅读全文
posted @ 2020-07-16 00:21 马蹄哒哒 阅读(459) 评论(0) 推荐(0)
摘要: from PyPDF2 import PdfFileReader,PdfFileWriter from copy import copy 读取=PdfFileReader("E:\pdf\水印.pdf") 水印=读取.getPage(0) 读pdf=PdfFileReader("E:\pdf\表格. 阅读全文
posted @ 2020-07-15 23:42 马蹄哒哒 阅读(121) 评论(0) 推荐(0)
摘要: import os def f(路径): 目录名称=os.path.basename(路径) if not os.path.exists(路径): #os.mkdir(路径) #创建单级目录 os.makedirs(路径) #创建多级目录 print("创建目录{}成功".format(目录名称)) 阅读全文
posted @ 2020-07-15 15:28 马蹄哒哒 阅读(113) 评论(0) 推荐(0)
摘要: import glob import os import time os.chdir("E:\pdf") 所有文件=glob.glob(r'**/*.pdf',recursive=True) #查看文件属性 for i in 所有文件: 文件大小=os.stat(i).st_size/1024/10 阅读全文
posted @ 2020-07-15 15:20 马蹄哒哒 阅读(268) 评论(0) 推荐(0)
摘要: from PyPDF2 import PdfFileWriter,PdfFileReader n=1 读pdf=PdfFileReader(r"E:\pdf\python.pdf") for page in range(0,读pdf.getNumPages()): 写pdf=PdfFileWrite 阅读全文
posted @ 2020-07-15 15:07 马蹄哒哒 阅读(560) 评论(0) 推荐(0)
摘要: from PyPDF2 import PdfFileWriter,PdfFileReader 读pdf=PdfFileReader(r"E:\pdf\python.pdf") 写pdf=PdfFileWriter() for page in range(读pdf.getNumPages()-1,-1 阅读全文
posted @ 2020-07-15 14:49 马蹄哒哒 阅读(247) 评论(0) 推荐(0)
摘要: from PyPDF2 import PdfFileReader,PdfFileWriter 读pdf=PdfFileReader(r"E:\pdf\python.pdf") 写pdf=PdfFileWriter() 页=读pdf.getPage(0).rotateClockwise(90) #顺时 阅读全文
posted @ 2020-07-15 12:05 马蹄哒哒 阅读(193) 评论(0) 推荐(0)
摘要: import os import fnmatch ls=os.listdir(r"E:\pdf") #列出文件夹下所有的文件 for 文件名 in ls: if fnmatch.fnmatch(文件名,"[!a-z].pdf"): print(文件名) 1.pdf2.pdf3.pdf4.pdf>>> 阅读全文
posted @ 2020-07-14 22:17 马蹄哒哒 阅读(302) 评论(2) 推荐(0)
摘要: import glob import os os.chdir(r"E:\pdf") filedir=glob.glob("**\*.txt",recursive=True) #glob.iglob用也一样 for i in filedir: print(i) 文本.txt文件夹_1\文本.txt文件 阅读全文
posted @ 2020-07-14 22:06 马蹄哒哒 阅读(1144) 评论(0) 推荐(0)
摘要: import re >>> c="PandAs练习.xlsx" >>> re.match(".*pandas.*",c,re.I) <re.Match object; span=(0, 13), match='PandAs练习.xlsx'> >>> d=re.match(".*pandas.*",c 阅读全文
posted @ 2020-07-14 21:57 马蹄哒哒 阅读(874) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 ··· 17 下一页