I need pass function to another function with some parameters specified. So half of parameters I need assign before passing function and other parameters would be given inside another function. How to do that?
-
Can you explain your question a little better, maybe give some example code? I'm a little confused about what your question actually is-- is it "can I pass parameters in function calls?" because the answer is yes.Colleen– Colleen2012-04-23 21:07:33 +00:00Commented Apr 23, 2012 at 21:07
Add a comment
|
1 Answer
This is exactly what functools.partial does. For example:
other_function(callback=functools.partial(the_other_function, param1='foo', param2='bar'))