Python图片转为字节
2019-08-21 本文已影响0人
king2king
Python图片转为字节
#图片URL
image_src = "https://static.geetest.com/nerualpic/word_l1_zh_2019.08.02/thota/6384bfb85ba10c02c69d02dda8ba535c.jpg?challenge=1ad1e140b00b3a62433610a1ff404e0f"
image_src = image_src + 'png'
image = urllib.request.urlretrieve(image_src, filename='captcha.png')
im = open('captcha.png', 'rb').read()