2
A
回答
10
检查是你在这种情况下
>>> def testFunc(arg1, arg2, arg3, additional='test'):
... print arg1
...
>>> import inspect
>>> inspect.getargspec(testFunc)
ArgSpec(args=['arg1', 'arg2', 'arg3', 'additional'], varargs=None, keywords=None, defaults=('test',))
>>>
4
从功能外,你可以使用inspect.getargspec():http://docs.python.org/library/inspect.html#inspect.getargspec
2
朋友看看在inspect.getargspec(func)命令。这给了你一个元组,其中的第一个元素是所需参数的列表。
相关问题
- 1. 计算Python中参数的实数
- 2. Mysql的计算函数的参数
- 3. XQuery:计算函数的参数
- 4. Python 3.3.4函数没有计算出一定的参数
- 5. PHP函数计算传递给函数的参数数量
- 6. C++ 11:计算可变参数函数参数
- 7. Python参数计数
- 8. Sharepoint计算字段函数参考
- 9. Python函数参数
- 10. Python /函数参数
- 11. Python中计算excel日期的函数
- 12. Python函数计算会员价
- 13. 使用计算GCD - Python函数返回
- 14. 的Python,sympy计算多变量函数
- 15. 使用Python计算CRC zlib.crc32函数
- 16. 计算参数值
- 17. Python数学计算
- 18. CSS计算“函数”
- 19. AVR函数计算
- 20. 计算sigmoid函数
- 21. PHP计算函数
- 22. 函数计算logarit
- 23. 从另一个函数调用函数进行计算(Python)
- 24. 从另一个函数计算平均值的Python函数
- 25. 使用数据帧的列参数计算R函数
- 26. 计算克隆函数的可变参数个数
- 27. 作为函数参数的Python函数?
- 28. 函数计算postgresql中的总计数
- 29. Python函数参考
- 30. python和函数参数
可能的重复:http://stackoverflow.com/questions/990016/how-to-find-out-the-arity-of-a-method-in-python,http://stackoverflow.com/questions/ 3913963 /长度的论点-的-蟒功能/ 3915056#3915056 – mouad 2011-01-12 22:52:26