How to call a function using apply with keyword args?

Achim Domma achim.domma at syynx.de
Thu Jun 13 03:09:25 EDT 2002


Hi,

I have a function like this:

def MyFkt(A,B,C): pass

and some parameters from a config file:

params = {'A':5,'B':8,'C':9}

how can I call MyFkt with this parameters? I tried apply(MyFkt,[],params)
but get this error:

TypeError: MyFkt() takes exactly 3 non-keyword arguments (0 given)

any idea?

greetings
Achim





More information about the Python-list mailing list