summaryrefslogtreecommitdiff
path: root/scipy/weave/examples/support_code_example.py
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2005-09-26 20:20:16 +0000
committerTravis Oliphant <oliphant@enthought.com>2005-09-26 20:20:16 +0000
commit45d01a4be1c4221132ba46d687e6af3a8df3329b (patch)
treece3be5290e918def7c7187e747c5460193b0ca85 /scipy/weave/examples/support_code_example.py
parentccd1c3db37672627aa4fe0fdb5437f5dddc0fe86 (diff)
downloadnumpy-45d01a4be1c4221132ba46d687e6af3a8df3329b.tar.gz
Moved weave
Diffstat (limited to 'scipy/weave/examples/support_code_example.py')
-rw-r--r--scipy/weave/examples/support_code_example.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/scipy/weave/examples/support_code_example.py b/scipy/weave/examples/support_code_example.py
new file mode 100644
index 000000000..ed2bb5a31
--- /dev/null
+++ b/scipy/weave/examples/support_code_example.py
@@ -0,0 +1,18 @@
+import sys
+sys.path.insert(0,'..')
+import inline_tools
+
+
+support_code = """
+ PyObject* length(std::string a)
+ {
+ int l = a.length();
+ return PyInt_FromLong(l);
+ }
+ """
+a='some string'
+val = inline_tools.inline("return_val = length(a);",['a'],
+ support_code=support_code)
+print val
+
+ \ No newline at end of file