Last active
December 15, 2018 05:02
-
-
Save dmitriiweb/c89040799577c75c893ac51775139fad to your computer and use it in GitHub Desktop.
Revisions
-
Dmitrii K revised this gist
Dec 15, 2018 . No changes.There are no files selected for viewing
-
Dmitrii K revised this gist
Feb 15, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ import requests import shutil r = requests.get('url', stream=True) if r.status_code == 200: with open(path, 'wb') as f: r.raw.decode_content = True -
Dmitrii K created this gist
Feb 15, 2018 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ import requests import shutil r = requests.get(settings.STATICMAP_URL.format(**data), stream=True) if r.status_code == 200: with open(path, 'wb') as f: r.raw.decode_content = True shutil.copyfileobj(r.raw, f)