Last active
March 5, 2020 02:23
利用PIL保存url图片
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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