上一页 1 2 3 4 5 6 7 8 ··· 17 下一页
摘要: a="文件1.xlsx" 点的位置=a.rfind(".") #取出.xlsx b=a[点的位置:] 阅读全文
posted @ 2020-07-14 21:49 马蹄哒哒 阅读(482) 评论(0) 推荐(0)
摘要: import os j=0 for 文件夹路径,子文件夹列表,文件列表 in os.walk(r'E:\pdf'): #生成所有的文件路径 for i in 文件列表: print(文件夹路径+i) j+=1 print('发现了{}个文件'.format(j)) 阅读全文
posted @ 2020-07-14 13:28 马蹄哒哒 阅读(477) 评论(0) 推荐(0)
摘要: from PyPDF2 import PdfFileReader,PdfFileWriter 写pdf=PdfFileWriter() for i in range(1,5): 读pdf=PdfFileReader('{}.pdf'.format(i)) for j in range(读pdf.ge 阅读全文
posted @ 2020-07-14 11:27 马蹄哒哒 阅读(200) 评论(0) 推荐(0)
摘要: from PyPDF2 import PdfFileReader,PdfFileWriter 读pdf=PdfFileReader(r'E:\pdf\python.pdf') for i in range(读pdf.getNumPages()): 写pdf=PdfFileWriter() 写pdf. 阅读全文
posted @ 2020-07-14 11:18 马蹄哒哒 阅读(227) 评论(0) 推荐(0)
摘要: import pdfplumber import pandas #将表格写进csv文件 #with pdfplumber.open(r'E:\pdf\表格.pdf') as f: #for page in f.pages: #for table in page.extract_tables(): # 阅读全文
posted @ 2020-07-14 11:04 马蹄哒哒 阅读(517) 评论(0) 推荐(0)
摘要: import os for i in os.scandir(r'E:\pandas练习'): print('文件名:',i.name) print('文件的绝对路径:',i.path) print('是否是文件夹:',i.is_dir()) print('是否是文件:',i.is_file()) p 阅读全文
posted @ 2020-07-13 17:32 马蹄哒哒 阅读(1483) 评论(0) 推荐(0)
摘要: >>> import datetime >>> datetime.datetime.fromtimestamp(1698668998) datetime.datetime(2023, 10, 30, 20, 29, 58) >>> a=datetime.datetime.fromtimestamp( 阅读全文
posted @ 2020-07-13 17:30 马蹄哒哒 阅读(1113) 评论(0) 推荐(0)
摘要: import pdfplumber as pdf with pdf.open(r'E:\pdf\python.pdf')as f: for i in f.pages: con=i.extract_text() print(con) 阅读全文
posted @ 2020-07-13 12:12 马蹄哒哒 阅读(183) 评论(0) 推荐(0)
摘要: import os b=os.path.join(r'C:\\','asc') #拼接路径 print(b) os.chdir(r'E:\pandas练习') #指定当前的py文件所在目录 print(os.getcwd()) #查看当前py文件所在目录 a=os.listdir() #获取当前目录 阅读全文
posted @ 2020-07-13 11:41 马蹄哒哒 阅读(126) 评论(0) 推荐(0)
摘要: from docx import Document from docx.shared import Pt from docx.enum.text import WD_ALIGN_PARAGRAPH #导入对齐库 文件=Document(r'E:\word练习\页眉页脚.docx') 第一节=文件.s 阅读全文
posted @ 2020-07-12 10:54 马蹄哒哒 阅读(785) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 ··· 17 下一页