when ever I need to use the struct module <br>I always store my values in a list or a dict, then<br>I do something like the code below <br><br>import struct<br>list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]<br>length =len(list)<br>
struct.pack(">%di"%(length), *[i for i in list])<br><br>now I can not remember where I came up with that,<br>I thought I read it in the python docs somewhere <br>but I can not find any mention of it now.<br><br>
<br><br>