I am trying to encode a text string to base64.
i tried doing this :
name = \"your name\" print(\'encoding %s in base64 yields = %s\\n\'%(name,name.en
To compatibility with both py2 and py3
import six import base64 def b64encode(source): if six.PY3: source = source.encode('utf-8') content = base64.b64encode(source).decode('utf-8')