Is there a way to print out a function's parameter list? For example:
def func(a, b, c):
pass
print_func_parametes(func)
Which will produce something like:
["a", "b", "c"]
Read the source. Seriously. Python programs and libraries are provided as source. You can read the source.
Use the inspect module.
>>> import inspect
>>> inspect.getargspec(func)
(['a', 'b', 'c'], None, None, None)
The first part of returned tuple is what you're looking for.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With