You can use the base64 module and the decode function to decode a base64 string. To decode a utf-8 string, you can use the decode function on the bytes object after decoding from base64.
Here's an example code snippet:
main.py216 chars9 lines
This should output Hello World!. The encode function is used to convert the string to a bytes object. The base64-encoded string is then decoded using the b64decode function from the base64 module, and the resulting bytes are decoded using the decode function with the utf-8 encoding.
gistlibby LogSnag