-3

I´m interested in downloading a .jpg file from the Internet. I would like to know a function or anyway that lets me to download files from the python console. So I suppose the way would be more or less in that way:

pythondonwloadfunction(URLofthefile, rootwheresavethedonwloadedfile)
0

1 Answer 1

0
import requests
with open('img.jpg', 'wb') as f:
    f.write(requests.get('<image_url>').content)

Not the answer you're looking for? Browse other questions tagged or ask your own question.