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 @ 2022-02-15 14:31  睡到自然醒ccc  阅读(881)  评论(0编辑  收藏  举报