How to find the number of parameters to a Python function from C?

后端 未结 3 430
没有蜡笔的小新
没有蜡笔的小新 2021-01-20 05:13

I\'m using the Python C API to call Python functions from my application. I\'d like to present a list of functions that could be called and would like to be able to limit th

3条回答
  •  借酒劲吻你
    2021-01-20 05:35

    Your C code can call inspect.getargspec just like any Python code would (e.g. via PyObject_CallMethod or other equivalent ways) and get all the scoop about the signature of each function or other callable that it may care about.

提交回复
热议问题