Created
April 5, 2016 01:00
-
-
Save nicholasblexrud/d5b28eefb4211bf130bfa3e844b8e3c0 to your computer and use it in GitHub Desktop.
Encode file content to base64
This file contains 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("yourfile.ext", "rb") as image_file: | |
encoded_string = base64.b64encode(image_file.read()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment