Answers for "fiel to base64 python"

-1

convert file to base64 python

import base64
data = open("sample.txt", "r").read()
encoded = base64.b64encode(data)
Posted by: Guest on November-09-2021
0

fiel to base64 python

import base64

with open("yourfile.ext", "rb") as image_file:
    encoded_string = base64.b64encode(image_file.read())
Posted by: Guest on March-31-2022

Python Answers by Framework

Browse Popular Code Answers by Language