> Can anybody tell me how to call "f" in my C code?
Assuming you already have a handle to an instance of MyClass this should
do the trick:
PyObject *func = PyObject_GetAttrString(MyClassInst,"f");
if(func) {
PyObject *result = PyObject_CallObject(func,NULL);
if(result) {
//Do
Hi
I am trying to write a C code to call a class function in a python
module. Here's my python module:
def fib(n):# write Fibonacci series up to n
a, b = 0, 1
while b < n:
print b,
a, b = b, a+b
def fib2(n): # return Fibonacci series up to n
result = []
a, b =