view swig/python/test.py @ 92:35a3bb5c3ffd

Java bindings (with simple test) now working. Unified Python and Java bindings tests.
author Jamie Bullock <jamie@postlude.co.uk>
date Thu, 06 Sep 2007 14:05:37 +0000
parents 525bfdf936c6
children 1cbbe5b5e461
line wrap: on
line source
#!/usr/bin/python

try:
    import xtract
except ImportError:
    print 'Failed to load the library "jxtract"'

print '\nRunning libxtract Python bindings test...\n'

len = 5

a = xtract.floatArray(len)
temp = []

for i in range(0, len):
    a[i] = 2 * i
    temp.append(str(a[i]))

print 'The mean of ' + ', '.join(temp) + ' is: %.2f' % \
	  xtract.xtract_mean(a,len,None)[1]

print '\nFinished!\n'