Filipe Teixeira wrote: > I have to open a binary file from an old computer and recover the > information stored (or at least try to). I use:
> I would like to convert these hex representations to int, but this If you want to do it efficiently have a look at the array module: >>> import os, array >>> a = array.array("B") >>> filename = "/usr/bin/python" >>> a.fromfile(open(filename, "rb"), os.path.getsize(filename)) >>> a[10] 0 >>> a[:10] array('B', [127, 69, 76, 70, 2, 1, 1, 0, 0, 0]) Peter -- http://mail.python.org/mailman/listinfo/python-list