Hi,
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 :
zobj=context.restrictedTraverse('path_to_script')
result=zobj()
# or
result=zobj(param1='aa',param2='bb')
Finding its arguments is also easy :
zobj.ZScriptHTML_tryParams()
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 ?
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 :
zobj=context.restrictedTraverse('path_to_script')
result=zobj()
# or
result=zobj(param1='aa',param2='bb')
Finding its arguments is also easy :
zobj.ZScriptHTML_tryParams()
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 ?