On 12/13/2015 7:24 PM, KP wrote:

data = list(f.read(4))
print data

from a binary file might give
In 2.x, a binary file and a text file are not distinguished.

['\x10', '\x20', '\x12', '\x01']
If a 'binary' file yields strings, you must be using 2.x.

How can I receive this instead?
[0x10, 0x20, 0x12, 0x01]
Use python 3.

--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to