Re: [Tutor] Handling binary file

2005-08-25 Thread John Purser
to Windows.  Worked just fine.   John Purser From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Julie LaiSent: Wednesday, August 24, 2005 18:20To: tutor@python.orgSubject: [Tutor] Handling binary file I have opened a file in binary mode. The 9th, 10th and 11th bytes contain

Re: [Tutor] Handling binary file

2005-08-25 Thread Alan Gauld
> I have opened a file in binary mode. > The 9th, 10th and 11th bytes contain the time in seconds. > In order to get this value in decimal I did the following: > > timeinsec = bytes[9] * 65536 + bytes[10] * 256 + bytes{11] > > Would someone please advise if there is a better way to do > this? You

[Tutor] Handling binary file

2005-08-24 Thread Julie Lai
I have opened a file in binary mode. The 9th, 10th and 11th bytes contain the time in seconds. In order to get this value in decimal I did the following:   timeinsec = bytes[9] * 65536 + bytes[10] * 256 + bytes{11]   Would someone please advise if there is a better way to do this?   Thanks, Julie.