Created
January 21, 2017 00:06
-
-
Save IanMcT/5d65f567df0e6aac493e6fa5c661c8b6 to your computer and use it in GitHub Desktop.
Get image from file.
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 #part of the standard library | |
#provide the url to open | |
u = urllib.request.urlopen('https://docs.python.org/3/_static/py.png') | |
#write the image data to a file | |
with open('p.png','wb') as f: | |
f.write(u.read()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment