Created
November 3, 2017 17:29
-
-
Save baobao/f9881eb9e012a42b676ab6411c9b3b98 to your computer and use it in GitHub Desktop.
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 urllib.request | |
url = "https://cdn-ak.f.st-hatena.com/images/fotolife/e/esakun/20150730/20150730215258.gif" | |
savename = "test.png" | |
memory = urllib.request.urlopen(url).read(); | |
# w・・・書き込み | |
# b・・・バイナリ | |
# wbとはバイナリ書き込みを意味する | |
with open(savename, mode="wb") as f: | |
f.write(memory) | |
print("save complete") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment