source: SHX/trunk/sandbox/floattest.py @ 130

Revision 130, 290 bytes checked in by marcus, 11 years ago (diff)
  • some pointer arithmetic tests
  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Author Revision Date
Line 
1# -*- coding: utf-8 -*-
2
3import ctypes as C
4
5lib = C.CDLL("./floatarray.so")
6lib.init()
7lib.display()
8
9lib.getdata.restype = C.c_void_p
10data = lib.getdata()
11print "0x%x" % data
12
13for i in xrange(10):
14    x = C.cast(data+C.sizeof(C.c_float)*i, C.POINTER(C.c_float))
15    print x.contents.value
Note: See TracBrowser for help on using the repository browser.