Source

pysvmlight / svmlight / test.py

Full commit
from ctypes import *

class PY1(Structure):
	_fields_ = [("i", c_int),
			    ("arr", POINTER(c_int))]

class PY2(Structure):
	_fields_ = [("pytest", POINTER(PY1))]

if __name__ == "__main__":
	t = CDLL("./test.so")
	py1 = PY1()
	py1.i = 5
	ints = (c_int * 5)()
	ints[2] = 99
	py1.arr = ints
	py2 = PY2()
	py2.pytest = pointer(py1)
	print "hi"
	t.stuff(pointer(py2))
	for i in ints:
		print i