bill nieuwendorp wrote:
> 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])

You don't need the list comprehension here, just write
struct.pack(">%di"%(length), *list)

Kent
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to