Skip to content Skip to sidebar Skip to footer

Python: Converting File To Base64 Encoding

This is my code: import base64 with open('/Users/Bob/test.txt') as f: encoded = base64.b64encode(f.readlines()) print(encoded) I've based it on the base64 documentation.

Solution 1:

You have a script named base64.py which is shadowing the stdlib module. Rename it.


Post a Comment for "Python: Converting File To Base64 Encoding"