随笔分类 -  办公自动化

摘要:0、创建数据 import random import numpy as np import pandas as pd from string import ascii_uppercase as U_CASES random.seed(19990702) name = sorted([''.join 阅读全文
posted @ 2020-06-19 22:21 赏尔 阅读(3673) 评论(0) 推荐(0) 编辑
摘要:0、import import openpyxl from openpyxl.styles import colors, fills, Font, PattrernFill 1、查看填充类型 print(dir(fills)) fill_types = [ 'FILL_PATTERN_DARKDOW 阅读全文
posted @ 2020-02-29 23:33 赏尔 阅读(19172) 评论(0) 推荐(0) 编辑
摘要:0、import import openpyxl form openpyxl.styles import Border, borders, colors, Side 1、查看边框线的内置 styles print(dir(borders)) border_styles = ['BORDER_DASH 阅读全文
posted @ 2020-02-28 22:43 赏尔 阅读(8699) 评论(0) 推荐(0) 编辑
摘要:0、import import openpyxl from openpyxl.styles import colors 1、插入 sheet wb = openpyxl.Workbook() wb.sheetnames wb.create_sheet(title='my_sheet', index= 阅读全文
posted @ 2020-02-27 22:20 赏尔 阅读(6205) 评论(0) 推荐(0) 编辑
摘要:版本信息: 需求: 脚本: # import import re import openpyxl from copy import copy # 封装函数 def cell_style(cell): '''获取给定单元格的四大样式属性''' alignment = copy(cell.alignme 阅读全文
posted @ 2020-02-26 21:44 赏尔 阅读(1138) 评论(0) 推荐(0) 编辑
摘要:需求: 0、imort import re import pandas as pd import openpyxl from openpyxl.utils import get_column_letter 1、查看表格数据信息 1.1 加载工作簿 wb = openpyxl.load_workboo 阅读全文
posted @ 2020-02-24 22:33 赏尔 阅读(957) 评论(1) 推荐(0) 编辑
摘要:0、import import numpy as np from pptx import Presentation from pptx.util import Inches from pptx.chart.data import BubbleChartDatafrom pptx.enum.chart 阅读全文
posted @ 2020-02-22 21:49 赏尔 阅读(787) 评论(0) 推荐(0) 编辑
摘要:柱形图、折线图、饼图、条形图、散点图 0、import import numpy as np from pptx import Presentation from pptx.util import Inches, Pt from pptx.chart.data import ChartData, X 阅读全文
posted @ 2020-02-21 22:14 赏尔 阅读(4959) 评论(0) 推荐(0) 编辑
摘要:1、显示图例的簇状柱形图 # import import os from pptx import Presentation from pptx.util import Cm from pptx.chart.data import ChartData from pptx.enum.chart impo 阅读全文
posted @ 2020-02-20 22:57 赏尔 阅读(3488) 评论(1) 推荐(0) 编辑
摘要:1、代码 # 加载库 import os import pandas as pd from pptx import Presentation from pptx.util import Cm, Pt from pptx.enum.text import PP_ALIGNfrom pptx.dml.c 阅读全文
posted @ 2020-02-17 22:22 赏尔 阅读(6768) 评论(1) 推荐(0) 编辑
摘要:1、添加流程箭头 # 加载库 import os from pptx import Presentation from pptx.util import Inches, Pt from pptx.enum.text import PP_ALIGN from pptx.enum.shapes impo 阅读全文
posted @ 2020-02-14 22:16 赏尔 阅读(2946) 评论(0) 推荐(0) 编辑
摘要:1、简单插入图片 # 加载库 import os from pptx import Presentation # 设置路径 work_path = r'E:\pyspace\tmp\pptx' os.chdir(work_path) # 实例化 ppt 文档对象 prs = Presentation 阅读全文
posted @ 2020-02-11 23:12 赏尔 阅读(6056) 评论(0) 推荐(0) 编辑
摘要:说明: python-pptx 写入文本,如果没有换行符,默认是一行。要实现自动换行的效果,应该在适当的地方插入换行符。 代码: # 加载库 import os from pptx import Presentation from pptx.util import Cm, Pt from pptx. 阅读全文
posted @ 2020-02-08 02:14 赏尔 阅读(8319) 评论(0) 推荐(0) 编辑
摘要:0、安装 python-pptx 库 pip install python-pptx 1、创建一张空幻灯片 # 加载库 import os from pptx import Presentation # 修改路径 work_path = r'E:\pyspace\tmp\pptx' os.chdir 阅读全文
posted @ 2020-02-05 23:41 赏尔 阅读(2194) 评论(0) 推荐(0) 编辑
摘要:python-pptx 官方文档地址https://python-pptx.readthedocs.io/en/latest/ pptx 涉及的的基类 prs # pptx 对象 slides # 幻灯片 shapes # 幻灯片的内容,用shapes.title、add_textbox、add_p 阅读全文
posted @ 2020-02-03 22:04 赏尔 阅读(584) 评论(0) 推荐(0) 编辑
摘要:简介: .docx 文件结构在 python-docx 中的三种类型: Document 对象表示整个文档;Paragrapha 对象标识段落(在输入文档,每一次回车产生新段落);Run 对象标识相同样式的文本延续。 Document 对象包含一个 Paragrapha 对象的列表,Paragrap 阅读全文
posted @ 2019-10-11 22:57 赏尔 阅读(9141) 评论(0) 推荐(1) 编辑
摘要:首先创建一个包含邮箱地址、密码、收件人的字典 import smtplib from email.mime.text import MIMEText from email.header import Header email = {'sender': '*****@126.com', 'passwo 阅读全文
posted @ 2019-09-10 20:46 赏尔 阅读(262) 评论(0) 推荐(0) 编辑
摘要:1 环境信息 2 新建空表 空表 3 写入数据 空单元格 写入 效果: 阅读全文
posted @ 2019-06-22 21:59 赏尔 阅读(1837) 评论(0) 推荐(0) 编辑
摘要:1 配置信息: 创建 excel 工作簿之前的路径 2 创建工作簿 创建工作簿之后的路径 工作簿内容 3 创建工作表 工作簿信息 阅读全文
posted @ 2019-06-21 21:02 赏尔 阅读(2726) 评论(0) 推荐(0) 编辑
摘要:生成效果如下的 九九乘法表 import os, openpyxl from openpyxl.styles import Font #path = 'D:\\pyspace' #os.chdir(path) wb = openpyxl.Workbook() sheet = wb.active #从 阅读全文
posted @ 2019-05-26 22:18 赏尔 阅读(651) 评论(0) 推荐(0) 编辑

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