aboutsummaryrefslogtreecommitdiff
path: root/swig/python
diff options
context:
space:
mode:
authorJamie Bullock <jamie@postlude.co.uk>2007-09-06 14:05:37 +0000
committerJamie Bullock <jamie@postlude.co.uk>2007-09-06 14:05:37 +0000
commit1f22cd5a7ddd3030c0c47f0528f5b2068f6b5283 (patch)
treeca4cb41e59e4c8b2a98df3a166e48d38df526d3a /swig/python
parent29e943f0788bff5a51005241574cb881fbf26ac7 (diff)
downloadLibXtract-1f22cd5a7ddd3030c0c47f0528f5b2068f6b5283.tar.gz
LibXtract-1f22cd5a7ddd3030c0c47f0528f5b2068f6b5283.tar.bz2
LibXtract-1f22cd5a7ddd3030c0c47f0528f5b2068f6b5283.zip
Java bindings (with simple test) now working. Unified Python and Java bindings tests.
Diffstat (limited to 'swig/python')
-rw-r--r--swig/python/test.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/swig/python/test.py b/swig/python/test.py
index f491a39..4d994ac 100644
--- a/swig/python/test.py
+++ b/swig/python/test.py
@@ -1,15 +1,22 @@
#!/usr/bin/python
-import xtract
+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]))
-retval,result = xtract.xtract_mean(a,len,None)
-
-print result
+print 'The mean of ' + ', '.join(temp) + ' is: %.2f' % \
+ xtract.xtract_mean(a,len,None)[1]
+print '\nFinished!\n'