mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-12 02:06:18 +03:00
8 lines
285 B
Python
8 lines
285 B
Python
import sys, os, urllib.parse, urllib.request
|
|
name = urllib.parse.urlsplit(sys.argv[1])[2].split('/')[-1]
|
|
if not os.path.exists(name):
|
|
print("Fetching", sys.argv[1])
|
|
content = urllib.request.urlopen(sys.argv[1]).read()
|
|
with open(name, 'wb') as fd:
|
|
fd.write(content)
|