+ 3
How to encode and decode a string in python?
i use this code but I got error. x='Hello man' y=x.encode('base64','strict') print(y) error= 'base64' is not a text encoding; use codecs.encode() to handle arbitrary codecs.
1 ответ
+ 5
In Python3, if you want base64
import base64, use b64encode().
(Note, b64encode expects bytestrings)
bytestrings:
bytes("string", "ascii")
"string".encode()
b"string"
bytestring -> normal:
b"string".decode()
...