root/trunk/examples/arraytest/test.py

Revision 113, 0.5 kB (checked in by KirkMcDonald, 2 years ago)

* Improved Pyd's handling of arrays.
* Added Repr
* Added arraytest

Line 
1 import os.path, sys
2 import distutils.util
3
4 # Append the directory in which the binaries were placed to Python's sys.path,
5 # then import the D DLL.
6 libDir = os.path.join('build', 'lib.%s-%s' % (
7     distutils.util.get_platform(),
8     '.'.join(str(v) for v in sys.version_info[:2])
9 ))
10 sys.path.append(os.path.abspath(libDir))
11 from arraytest import Foo, get, set, test
12
13 #set([Foo(1), Foo(2), Foo(3)])
14 print ">>> get()"
15 print `get()`
16 print ">>> set([Foo(10), Foo(20)])"
17 set([Foo(10), Foo(20)])
18 print ">>> get()"
19 print `get()`
Note: See TracBrowser for help on using the browser.