converting list to multiple parameters
Oliver Rutherfurd
oliver at rutherfurd.net
Wed Sep 13 21:28:42 EDT 2000
More information about the Python-list mailing list
Wed Sep 13 21:28:42 EDT 2000
- Previous message (by thread): curses in Python2.0b1
- Next message (by thread): converting list to multiple parameters
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi Alex, That's it exactly! Thanks for the quick reply. -Ollie oliver at rutherfurd.net "Alex" <cut_me_out at hotmail.com> wrote in message news:etdem2oj5nu.fsf at x15-cruise-basselope.mit.edu... > > Ollie: > > 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? > > Yeah, use apply. Something like > > x = apply(struct.pack, ('3s3s3s',) + tuple(theList)) > > Alex. > > -- > Speak softly but carry a big carrot. >
- Previous message (by thread): curses in Python2.0b1
- Next message (by thread): converting list to multiple parameters
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list