converting list to multiple parameters

Oliver Rutherfurd oliver at rutherfurd.net
Thu Sep 14 00:15:22 CEST 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