Calling functions with dynamic arguments

Roberto Bonvallet Roberto.Bonvallet at cern.ch
Wed Nov 29 10:14:47 EST 2006


SeanDavis12 wrote:
> I have a dictionary like:
> 
> {"a":1, "b":2}
> 
> and I want to call a function:
> 
> def func1(a=3,b=4):
>    print a,b
> 
> so that I get a=1,b=2, how can I go about that?  

func1(**yourdict)

-- 
Roberto Bonvallet



More information about the Python-list mailing list