用于将图像发送到printi.me api的包
printipigeon的Python项目详细描述
打印鸽子
python包,用于将图像发送到printi api
安装时使用:
python3 -m pip install printipigeon
示例用法:
importprintipigeonaspppp.send_from_path("somewhere/cat.jpg")
将图像从内存发送到printi.me/gallery的示例:
importprintipigeonasppimportiofromPILimportImageimg=Image.open("somewhere/cat.jpg")forxinrange(100):foryinrange(255):img.putpixel((x,y),(y,y,y))f=io.BytesIO()img.save(f,format="PNG")f.seek(0,0)# writing to f has moved the positionpp.send_binary_image_data("art.png",f,"gallery")