I want to use a function that accepts kwargs, but the argument name is being retrieved from a separate process and is unknown before hand.
For example:
param = 'desired_param'
some_function(desired_param=5)
The problem is that I don't know the content of the param and so have to somehow pass it to some_function.
Is it possible to pass the content of the param to the function with a value?
some_function is not something I defined, so I don't have any control over it.
paramyou want to pass it to different parameter of thesome_functionyes? If it'sIntthen toparam_intand ifStringthen toparam_strfor example?d = {'desired_param':5},some_function(**d).desired_param, call would besome_function(desired_param=5), but ifparam` isother, call would besome_function(other=5). Does that make sense?