How to query a function and get a list of expected parameters?

2006-09-29 Thread Matthew Wilson
I'm writing a function that accepts a function as an argument, and I want to know to all the parameters that this function expects. How can I find this out in my program, not by reading the source? For example, I would want to know for the function below that I have to pass in two things: def

Re: How to query a function and get a list of expected parameters?

2006-09-29 Thread Nick Vatamaniuc
Matt, In [26]: inspect.getargspec(f) Out[26]: (['x1', 'x2'], None, None, None) For more see the inspect module. -Nick Vatamaniuc Matthew Wilson wrote: I'm writing a function that accepts a function as an argument, and I want to know to all the parameters that this function expects. How

Re: How to query a function and get a list of expected parameters?

2006-09-29 Thread George Sakkis
Matthew Wilson wrote: I'm writing a function that accepts a function as an argument, and I want to know to all the parameters that this function expects. How can I find this out in my program, not by reading the source? For example, I would want to know for the function below that I have to