On 13Nov2014 14:32, satishmlm...@gmail.com <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 best way is not to use "bytes" for something else when you know you will be using the builtin version as well. Using the same name for two things is generally a bad idea.

The second, and worse, way is to see the documentation for the "builtins" module.

Cheers,
Cameron Simpson <c...@zip.com.au>

Madness takes its toll.  Please have exact change.
       - Janice Hanes <jan...@anv.net>
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to