I am trying to pass a ctype variable to inline c code using scipy.weave.inline. One would think this would be simple. Documentation is good when doing it with normal python object types, however, they have a lot more features than I need, and It makes more sense to me to use ctypes when working with C. I am unsure, however, where my error is.
from scipy.weave import inline
from ctypes import *
def test():
y = c_float()*50
x = pointer(y)
code = """
#line 120 "laplace.py" (This is only useful for debugging)
int i;
for (i=0; i < 50; i++) {
x[i] = 1;
}
"""
inline(code, [x], compiler = 'gcc')
return y
output = test()
pi = pointer(output)
print pi[0]