CatOrNot/app/picture_downloader.py
2018-12-11 00:32:28 +01:00

11 lines
207 B
Python

import requests
def get_image_from_url(url):
f = open('pic.jpg','wb')
f.write(requests.get(url).content)
f.close()
f = open('pic.jpg','rb')
file = f.read()
f.close()
return file