F
Filipe Teixeira
Hi.
I have to open a binary file from an old computer and recover the
information stored (or at least try to). I use:
f=open('file.bin','rb')
a=f.read()
f.close()
a in now a string full of hex representations in the form:
a[6]='\x14'
a[7]='\x20'
I would like to convert these hex representations to int, but this
(the most obvious way) doesn't seem to be working
How can I do this?
Thanks
I have to open a binary file from an old computer and recover the
information stored (or at least try to). I use:
f=open('file.bin','rb')
a=f.read()
f.close()
a in now a string full of hex representations in the form:
a[6]='\x14'
a[7]='\x20'
I would like to convert these hex representations to int, but this
(the most obvious way) doesn't seem to be working
Traceback (most recent call last):q=a[6]
q '\x14'
int(q,16)
How can I do this?
Thanks