variable arguments, but on function call
You all know about "*arg" or "**args" in function definitions : so the function definition doesn't have to know about what are the arguments or how many of them...
Well I need the same concept, but on the caller side !
The function is defined with normal arguments.
I programatically receive the function argument names and values.
I now need to call it...
I'm under Zope, and the function is in fact another python script.
Because of Zope, no "eval" is available.
Calling the function without parameters, or with fixed ones is easy :
Finding its arguments is also easy :
Now how to make the call when I receive argument values from a list or a dictionery for example (not knowing how many of them) !?
Anybody has a bright idea ?
[answer to myself]
Althought not super-documented, the solution is simple :
can be called like this:
so I just have to build a dictionnary...
|All times are GMT. The time now is 03:15 AM.|
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.