[Tutor] Handling binary file
Julie Lai
julielai823 at yahoo.com.hk
Thu Aug 25 03:19:48 CEST 2005
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.
_______________________________________
·Q§Y®É¦¬¨ì·s email ³qª¾¡H
¤U¸ü Yahoo! Messenger http://messenger.yahoo.com.hk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20050825/bd6b38b1/attachment.htm
More information about the Tutor
mailing list