of course I take one more look through the docs after I send the origonal
message and stumble upon it right away.
http://www.python.org/doc/2.5/tut/node6.html#SECTION00674
On 7/29/07, bill nieuwendorp <[EMAIL PROTECTED]> wrote:
>
> when ever I need to use the struc
when ever I need to use the struct module
I always store my values in a list or a dict, then
I do something like the code below
import struct
list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
length =len(list)
struct.pack(">%di"%(length), *[i for i in list])
now I can not remember where I came up with that,
This list is full of people ready to help, I thank you all for the
time you have taken to reply.
Danny now I see where readline could cause headaches,.
Liam thanks for the examples they work great. The endianess will
always be in Big Endian (Motorola type) for this format.
I see why I should be
Hi John thanks for the tips
I had a bit of a typo in my first post
time = struct.unpack(">steps",c)
should read somthing more like
time = struct.unpack(">steps+f",c)
adding the f to tell structs it is in float format
the string substitution
seems like it would work but now I cant figure out h
hello all I am new to python and this list has been helpfull so far
I am trying to convert binary file to ascii
here is the format spec
steps = int 4
value = int 4
time = float 4 * steps
so in the python terminal terminal i convert it like this
>>> import struct
>>> import string
>>> f = file