get function arguments
Benny Mohr
news5 at bennymo.ch
Tue Nov 16 15:14:43 EST 2004
Thanks a lot, that's what I'm looking for
Benny
Steven Bethard wrote:
> Benny Mohr <news5 <at> bennymo.ch> writes:
>
>>How can I get the list of argumens of this function?
>
>
> Is this what you mean?
>
>
>>>>def myFunc(a,b,c='default'):
>
> ... pass
> ...
>
>>>>myFunc.func_code.co_varnames
>
> ('a', 'b', 'c')
>
> I don't know where (if?) the func_code attributes are documented, but you should
> be able to figure them out with a little object introspection (e.g. dir or an
> editor like PythonWin that does some code completion).
>
> Steve
>
More information about the Python-list
mailing list