How to call a function using apply with keyword args?

Achim Domma achim.domma at syynx.de
Thu Jun 13 07:22:14 EDT 2002


"Cliff Wells" <logiplexsoftware at earthlink.net> wrote in message
news:mailman.1023954797.13466.python-list at python.org...

> Python 2.1.1 (#1, Aug 13 2001, 19:37:40)
> [GCC 2.96 20000731 (Red Hat Linux 7.1 2.96-96)] on linux2
> Type "copyright", "credits" or "license" for more information.
> >>> def MyFkt(A,B,C):
> ...     print A, B, C
> ...
> >>> params = {'A':5,'B':8,'C':9}
> >>> apply(MyFkt,(),params)
> 5 8 9
> >>>

that's exactly what I wanted to do, but I missed one parameter. It works
now, thanks !





More information about the Python-list mailing list