<div dir="ltr">Hi everyone,<div><br></div><div style>Take a look at this question:</div><div style><br></div><div style><a href="http://stackoverflow.com/questions/16122435/python-3-how-do-i-use-bytes-to-bytes-and-string-to-string-encodings/16122472?noredirect=1#comment23034787_16122472">http://stackoverflow.com/questions/16122435/python-3-how-do-i-use-bytes-to-bytes-and-string-to-string-encodings/16122472?noredirect=1#comment23034787_16122472</a><br>

</div><div style><br></div><div style>Is there really no way to use base64 that's as short as:</div><div style><br></div><div style>    b'whatever'.encode('base64')</div><div style><br></div><div style>

Because doing this:</div><div style><br></div><div style><div>    import codecs</div><div>    codecs.decode(b"whatever", "base64_codec")</div><div><br></div><div style>Or this:</div><div style><br></div>

<div style><div>    import base64</div><div>    encoded = base64.b64encode(b'whatever')</div><div><br></div><div style>Is cumbersome!</div><div style><br></div><div style>Why can't I do something like b'whatever'.encode('base64')? Or maybe using a different method than `encode`?</div>

<div style><br></div><div style><br></div><div style>Thanks,</div><div style>Ram.</div></div></div></div>