Eric said:
I have the following hexadecimal string - '\xff\xff\xff' which i need
to convert to binary.
How would i go about doing this?
You'll need to explain more clearly, and possibly change how you
view such things, before anyone can help you with certainty.
What you show above is a *binary* sequence of bytes containing
three bytes, each with the value 255. The representation of
it which you copied (?) from the console contains printable
characters and extra stuff to make it easier to read, but that's
what you get from repr() on a binary string.
Do you actually want a string containing the six printable
characters 'FFFFFF'? If that's the case, it's not what you
would usually call "binary". Anyway, use binascii.hexlify()
for that...
Can you give an example of the output you really want? How
many bytes does it contain? How does it differ from the string
above?
-Peter