Note: The referenced duplicate questions doesn't fully answer my current problem.
In Python, I know how to pass a function as an argument, but how to pass its parameters too (which I don't how many they will be. ie a variable number)
for example, I tried:
def general_func(func_to_call, args):
val = func_to_call(args)
...
But here args is one single element, what if the function func_to_call takes 2 arguments? I want something like this:
general_func(test_function, p1, p2, p3)
Plus can I pass None instead of function? I've some cases in which if the user doesn't send parameters to general_func then to give val a default value.
*argsto another function). Between the two of them, your question is entirely answered.None? Just not call the function and use the default? Where does that come from? The sole non-duplicate part of your question is rather underspecified.