I want to know how to convert normal python list to C list with Cython , process it and return a python list. Like:
Python script:
import mymodule
a = [1,2,3,4,5,6]
len = len(a)
print(mymodule.process(a,len))
Cython script (mymodule.pyd):
cpdef process(a, int len):
cdef float y
for i in range(len):
y = a[i]
a[i] = y * 2
return a
I read about MemoryView and many others things but I not really unterstand what happen and a lot of example use Numpy ( I don't want to use it for avoid user of my script download a big package ... anyway I think it's don't work with my software ). I need a really simple example to understand what's happening exactly.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…