Convert byte string to base64-encoded string (output not being a byte string)
问题 I was wondering if it is possible to convert a byte string which I got from reading a file to a string (so type(output) == str ). All I've found on Google so far has been answers like How do you base-64 encode a PNG image for use in a data-uri in a CSS file?, which does seem like it would work in python 2 (where, if I'm not mistaken, strings were byte strings anyway), but which doesn't work in python 3.4 anymore. The reason I want to convert this resulting byte string to a normal string is