Dynamic function execution

Irmen de Jong irmen.NOSPAM at xs4all.nl
Sat Nov 25 10:50:17 EST 2006


Andy Wu wrote:
> Say I have a string 'minutes' and a integer 30, now I need to call the
> func this way: func(minutes = 30), how do I do this?

d={"minutes": 30}
func(**d)

This is "extended call syntax". You can read more about this when
you look up the (deprecated) "apply" function in the manual.

--Irmen



More information about the Python-list mailing list