1 2 3 4 5 6 7 8 9 10
|
bpython version 0.14.1 on top of Python 2.7.10 /usr/local/opt/python/bin/python2.7
>>> import urllib
>>> file_path, headers = urllib.urlretrieve('http://python.developpez.com/outils/PythonZope/images/cpython.gif', '/tmp/dev')
>>> file_path
'/tmp/dev'
>>> headers.items()
[('content-length', '2315'), ('accept-ranges', 'bytes'), ('expires', 'Thu, 10 Dec 2015 23:55:58 GMT'), ('server', 'Apache/2.2.29 (Unix) mod_ssl/2.2.29 OpenSSL/1.0.1p PHP/5.3.29'), ('last-modified', 'Tue, 08 Sep 2009 18:37:52 GMT'), ('etag', '"522e87-90b-4731543922000"'), ('cache-control', 'max-age=604800'), ('date', 'Thu, 03 Dec 2015 23:55:58 GMT'), ('content-type', 'image/gif'), ('age', '338')]
~/stash » file /tmp/dev
/tmp/dev: GIF image data, version 89a, 190 x 64 |
Partager