Last active
June 28, 2017 09:24
-
-
Save erika-dike/3a6ff6d4bea031587a219b74806fbaf3 to your computer and use it in GitHub Desktop.
Auto download images from site
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
import shutil | |
def save_image_to_file(image, dirname, suffix): | |
with open('{dirname}/img_{suffix}.jpg'.format(dirname=dirname, suffix=suffix), 'wb') as out_file: | |
shutil.copyfileobj(image.raw, out_file) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment