"convert" string to bytes without changing data (encoding)

Stefan Behnel stefan_ml at behnel.de
Wed Mar 28 05:08:24 EDT 2012


Peter Daum, 28.03.2012 10:56:
> is there any way to convert a string to bytes without
> interpreting the data in any way? Something like:
> 
> s='abcde'
> b=bytes(s, "unchanged")

If you can tell us what you actually want to achieve, i.e. why you want to
do this, we may be able to tell you how to do what you want.

Stefan




More information about the Python-list mailing list