pycurious/fix

view basic/example.py @ 1:1f54edaaab02

Added SWIG typemap example.
author James Brotchie <brotchie@gmail.com>
date Fri Dec 04 22:50:30 2009 +1000 (3 years ago)
parents
children
line source
1 """
2 Example to exercise the test SWIG module.
4 """
5 import os
6 import test
8 # Create and open pipe as file objects
9 (r,w) = os.pipe()
10 fr, fw = os.fdopen(r, 'r'), os.fdopen(w, 'w')
12 # Write and close
13 fw.write('Hello World')
14 fw.close()
16 # Read data from pipe using test module
17 print test.message(fr)