Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Encode file content to base64
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
You can’t perform that action at this time.