0

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?

1
  • 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. Commented Apr 23, 2012 at 21:07

1 Answer 1

6

This is exactly what functools.partial does. For example:

other_function(callback=functools.partial(the_other_function, param1='foo', param2='bar'))
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.