import urllib import cv2 import numpy as np
def index():
url = "a url"
url_response = urllib.urlopen(url)
img_array = np.array(bytearray(url_response.read()), dtype=np.uint8)
img = cv2.imdecode(img_array, -1)
cv2.imwrite("=========test.jpeg", img)
cv2.waitKey()
return 1
After running this code, my "=========test.jpeg" is a blank file. What's wrong with my code?