Skip to content

Instantly share code, notes, and snippets.

@geekgogo
Last active March 5, 2020 02:23
利用PIL保存url图片
from PIL import Image
import requests
from io import BytesIO
def download(url, name):
ret = requests.get(url)
image = Image.open(BytesIO(ret.content))
image.save(name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment