CatOrNot/app/picture_downloader.py

11 lines
207 B
Python
Raw Normal View History

2018-12-11 00:32:28 +01:00
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