On 2014-11-13 22:32, satishmlm...@gmail.com wrote:
file = open('data.bin', 'rb')
bytes = file.read()
bytes
b'\x00\x00\x00\x02spam\x00\x03?\x9d\xf3\xb6'
records = [bytes([char] * 8) for char in b'spam']
TypeError: 'bytes' object is not callable

How to recover bytes function?

The simple answer:

bytes = __builtins__.bytes

The smart answer:

Don't bind to 'bytes' in the first place!

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

Reply via email to