Thanks to all that responded. I chose a modified version of Scott's
second recommendation:

time = line[:8]
decoded_File.write( '%00.4f' % (int(time, 16) * .0001) + ', ')

'print >>' added a CRLF that I didn't need, so I went with '.print' (I
need to process about 20 values from the remaining bytes).

Thank you.

On 12/26/06, Scott David Daniels <[EMAIL PROTECTED]> wrote:
...
> > Any help is really appreciated.
> for line in AP_file:
>      print >>decoded_File, '%s.%04d' % divmod(int(line[:8], 16), 10000
>                                               ), line[9:].rstrip()
>
> or:
>
> for line in AP_file:
>      print >>decoded_File, '%.4f' % (int(line[:8], 16) * .0001
>                                               ), line[9:].rstrip()
...
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to