Konwertuj plik na Base64 Python

import base64
data = open("sample.txt", "r").read()
encoded = base64.b64encode(data)
MitchAloha