摘要:
import openpyxl from openpyxl.chart import LineChart, Reference workbook = openpyxl.load_workbook('file/data.xlsx') sheet = workbook['薪水'] # 创建折线图的图标对 阅读全文
摘要:
from docx import Document from docx.oxml.ns import qn from docx.shared import Pt, RGBColor doc = Document('file/春晓.docx') for para in doc.paragraphs: 阅读全文
摘要:
带水印的图片: # -*- coding: utf-8 -*- from PIL import Image print('程序进行中...') # img = Image.open('../file/带水印的图片.png') img = Image.open('../file/img.png') # 阅读全文
摘要:
# -*- coding: utf-8 -*- from PIL import Image im = Image.open(f'../file/python.png') print('图片大小:', im.size) print(im.getpixel((400, 88))) for i in ra 阅读全文
摘要:
原图片 # -*- coding: utf-8 -*- from PIL import Image # 图片的旋转 def demo1(): img = Image.open('../file/python.png') img.rotate(45).save('../file/旋转45度的图片.pn 阅读全文
摘要:
# 安装pillow # pip install pillow from PIL import Image # 图片的读取显示与保存 def demo1(): im = Image.open('../file/python.png') im.show() im.save('file/python.p 阅读全文
摘要:
# -*- coding: utf-8 -*- from PIL import Image logo = Image.open('../file/logo.png') im = Image.open('../file/拍摄图.png') # 将水印图片添加到图片的指定位置 im.paste(logo 阅读全文
摘要:
# -*- coding: utf-8 -*- from PIL import Image im = Image.open('../file/拍摄图.png') # 裁剪图片 def demo1(): box = (200, 0, 400, 150) region = im.crop(box) re 阅读全文
摘要:
# -*- coding: utf-8 -*- # 将PDF文档(文字版本)转换为WWord文档频率较高 利用pdf2docx 某块很好的实现这个需求 # 首先安装 pip install pdf2docx import os from pdf2docx import Converter old_f 阅读全文
摘要:
# -*- coding: utf-8 -*- import os from win32com.client import Dispatch path = os.getcwd() old_file_path = path + '\\file\\租房合同.docx' new_file_path = p 阅读全文