Lars Erik Gullerud wrote:
> Hello list,
> 
> I have the following problem; I have a list with an unknown number of 
> strings, like so:
> 
>    MyList = ['string1', 'string2', 'string3'..'stringN']
> 
> Now, I need to call a procedure from a 3rd party module (which is just a 
> wrapper around a C library), where each of these strings must be passed 
> as a separate argument, i.e.
> 
>    MyProc(arg1, arg2, arg3..argN)
> 
> So, the question is basically, how can I invoke this procedure and pass 
> each of these list elements as separate arguments, when I don't know in 
> advance how many elements there will be?

MyProc(*MyList)

More details here:
http://mail.python.org/pipermail/tutor/2007-March/053435.html

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

Reply via email to