Skip to content

How to download file in Python?

import urllib2

filedata = urllib2.urlopen('')
datatowrite =
with open('/Users/scott/Downloads/cat2.jpg', 'wb') as f:
See also  Python code snippet - How to add and subtract days datetime ?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.