Skip to content

Instantly share code, notes, and snippets.

@luxin88
Last active May 3, 2017 01:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luxin88/a9199da5e7e02ef896f6ce9fab350a02 to your computer and use it in GitHub Desktop.
Save luxin88/a9199da5e7e02ef896f6ce9fab350a02 to your computer and use it in GitHub Desktop.
下载链接图片
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
from PIL import Image
from io import BytesIO
url = u'http://grs.a.mvote.net/imgsource/global_AB7481EF-358F-0B95-F2FD-3C43CA06CE94.png'
r = requests.get(url)
i = Image.open(BytesIO(r.content))
i.save(u'img/AB7481EF-358F-0B95-F2FD-3C43CA06CE94.jpg', 'JPEG')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment