python Image open 读取网络图片本地显示

复制代码
#!/usr/bin/python3
# -*- coding: utf-8 -*-

import requests
from PIL import Image
from io import BytesIO

response = requests.get('https://static.geetest.com/pictures/gt/5629ed821/5629ed821.webp')
response = response.content

BytesIOObj = BytesIO()
BytesIOObj.write(response)
img = Image.open(BytesIOObj)
img.show()
复制代码

 

转载地址:https://www.cnblogs.com/Summer-skr--blog/p/11664212.html

posted @   睡到自然醒ccc  阅读(1474)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 零经验选手,Compose 一天开发一款小游戏!
· 一起来玩mcp_server_sqlite,让AI帮你做增删改查!!
点击右上角即可分享
微信分享提示