converting list to multiple parameters

Oliver Rutherfurd oliver at rutherfurd.net
Wed Sep 13 18:15:22 EDT 2000


Hi,

I'd like to pass an list of values to struct.pack(), but it tells me that
the parameters need to be strings.  It there a way I can convert the list to
a bunch of parameters?

so instead of:

x = struct.pack("3s3s3s", a, b, c)

I could do:

x = struct.pack("3s3s3s", thelist)

Thanks,
-Ollie
oliver at rutherfurd.net





More information about the Python-list mailing list