annotate 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
rev   line source
jamie@88 1 #!/usr/bin/python
jamie@88 2
jamie@92 3 try:
jamie@92 4 import xtract
jamie@92 5 except ImportError:
jamie@92 6 print 'Failed to load the library "jxtract"'
jamie@92 7
jamie@92 8 print '\nRunning libxtract Python bindings test...\n'
jamie@88 9
jamie@88 10 len = 5
jamie@88 11
jamie@88 12 a = xtract.floatArray(len)
jamie@92 13 temp = []
jamie@88 14
jamie@88 15 for i in range(0, len):
jamie@88 16 a[i] = 2 * i
jamie@92 17 temp.append(str(a[i]))
jamie@88 18
jamie@92 19 print 'The mean of ' + ', '.join(temp) + ' is: %.2f' % \
jamie@92 20 xtract.xtract_mean(a,len,None)[1]
jamie@88 21
jamie@92 22 print '\nFinished!\n'