05 2021 档案

摘要:使用Python对word文档进行操作 一、安装Python-docx Python-docx是专门针对于word文档的一个模块,只能读取docx 不能读取doc文件。说白了,python就相当于windows操作系统,QQ就是跑在windows操作系统上的软件,QQ最大的作用是可以去聊天,说话。 阅读全文
posted @ 2021-05-31 15:00 沭水之虾 阅读(219) 评论(0) 推荐(0) 编辑
摘要:from docx import Document from docx.shared import Inches document = Document() document.add_heading('Document Title', 0) p = document.add_paragraph('A 阅读全文
posted @ 2021-05-14 18:27 沭水之虾 阅读(110) 评论(0) 推荐(0) 编辑
摘要:1 from docx import Document 2 from docx.shared import Inches 3 4 document = Document() 5 6 document.add_heading('Document Title', 0) 7 8 p = document. 阅读全文
posted @ 2021-05-14 18:09 沭水之虾 阅读(153) 评论(0) 推荐(0) 编辑
摘要:# -*- coding: utf-8 -*- import os import re #设定文件路径 path=r'D:\郭鹏历届真题解析2007-2020' i=1 #对目录下的文件进行遍历 for file in os.listdir(path): #判断是否是文件 file_name=os. 阅读全文
posted @ 2021-05-14 16:57 沭水之虾 阅读(251) 评论(0) 推荐(0) 编辑
摘要:import re test_err_date = '如这样的日期2016-12-35也可以匹配到.测试如下.' print(re.search(r"(\d{4}-\d{1,2}-\d{1,2})",test_err_date).group(0)) 阅读全文
posted @ 2021-05-14 16:31 沭水之虾 阅读(426) 评论(0) 推荐(0) 编辑
摘要:# -*- coding: utf-8 -*- import os #设定文件路径 path=r'D:\郭鹏历届真题解析2007-2020' i=1 #对目录下的文件进行遍历 for file in os.listdir(path): #判断是否是文件 file_name=os.path.join( 阅读全文
posted @ 2021-05-14 16:10 沭水之虾 阅读(209) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示