Literal Escaped Octets

Alex Martelli aleaxit at yahoo.com
Mon Feb 6 00:07:23 EST 2006


Chason Hayes <chasonh at hotmail.com> wrote:
   ...
> easily in c/c++ but I need to do it in python. I am not sure how to read
> and evaluate the binary value of a byte in a long string when it is a non
> printable ascii value in python.

If you have a bytestring (AKA plain string) s, the binary value of its
k-th byte is ord(s[k]).


Alex



More information about the Python-list mailing list