from io import BytesIO
from openpyxl.drawing.image import Image
# BytesIO可以将数据存入内存,模拟文件的操作方式read或者write
f = BytesIO()
f.write(requests.get(url).content)
f.seek(0)
img = Image(f)
newsize = (70, 70)
sh.row_dimensions[row].height = 70.0
img.width, img.height = newsize
sh.add_image(img, '%s%s' % ("H", row))
标签:openpyxl,img,image,height,插入,图片,BytesIO,row
From: https://www.cnblogs.com/wtil/p/17083460.html