--- vegetax <[EMAIL PROTECTED]> wrote: > how can i pass it to a generic function that takes variable > keywords as > arguments? same thing with variable arguments, i need to pass a > list of > arguments to the function > > def asd(**kw): print kw > def efg(*arg): print arg > > asd(d) > doesnt work > asd(kw = d) > doesnt work
You need to use it as follows: >>> def foo(**args): ... '''Takes in key=value parameters.''' ... for key, value in args.items(): ... print key, '->', value ... >>> foo(a=1,b=2) a -> 1 b -> 2 Hope this makes some sense, Swaroop C H Blog: http://www.swaroopch.info Book: http://www.byteofpython.info -- http://mail.python.org/mailman/listinfo/python-list