Created
June 14, 2018 14:41
-
-
Save jtemporal/513cb095ad6bf92b38cfdb420e986aa2 to your computer and use it in GitHub Desktop.
read image bytes and turn it into base64 string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import base64 | |
with open('test_img.png', 'rb') as img_data: | |
img = img_data.read() | |
print(base64.encodebytes(img).decode()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment