Re: passing a variable argument list to a function

2008-08-13 Thread Scott
> Yeah. It's so easy and obvious that you are going to bang your head > against the wall. :) The single star does not only collect all arguments > in a function definition. It also expands a sequence as arguments. Thanks Christian, that worked perfectly! Scott -- http://mail.python.org/mailman/l

Re: passing a variable argument list to a function

2008-08-12 Thread Christian Heimes
Scott wrote: I suspect there's a simple bit of syntax that I'm missing -- can anyone give me a hand? Yeah. It's so easy and obvious that you are going to bang your head against the wall. :) The single star does not only collect all arguments in a function definition. It also expands a sequenc

passing a variable argument list to a function

2008-08-12 Thread Scott
I'm trying to write a function that accepts a variable number of arguments and passes those arguments to another function. Here is an example: def foo(*args): print "I'm going to call bar with the arguments", args bar(args) This doesn't do quite what I want. For example, if I call foo(1,2