Author: duncan
Date: Sun Oct 14 13:06:48 2007
New Revision: 9982
Log:
An example Pyrex program
(http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/)
Added:
branches/rel-1/testing/Duncan/pyrex/ (props changed)
branches/rel-1/testing/Duncan/pyrex/setup.py
branches/rel-1/testing/Duncan/pyrex/test1.mak
branches/rel-1/testing/Duncan/pyrex/test1.pyx
Added: branches/rel-1/testing/Duncan/pyrex/setup.py
==============================================================================
--- (empty file)
+++ branches/rel-1/testing/Duncan/pyrex/setup.py Sun Oct 14 13:06:48 2007
@@ -0,0 +1,10 @@
+from distutils.core import setup
+from distutils.extension import Extension
+from Pyrex.Distutils import build_ext
+setup(
+ name = "MyFirstTest",
+ ext_modules=[
+ Extension("test1", ["test1.pyx"], libraries = ["xosd"])
+ ],
+ cmdclass = {'build_ext': build_ext}
+)
Added: branches/rel-1/testing/Duncan/pyrex/test1.mak
==============================================================================
--- (empty file)
+++ branches/rel-1/testing/Duncan/pyrex/test1.mak Sun Oct 14 13:06:48 2007
@@ -0,0 +1,11 @@
+test1.so: test1.o
+ gcc -shared $< -o $@
+
+test1.c: test1.pyx
+ pyrexc test1.pyx
+
+CC=gcc
+CFLAGS=-fPIC -I/usr/include/python2.4
+
+clean:
+ rm test1.o test1.c test1.so
Added: branches/rel-1/testing/Duncan/pyrex/test1.pyx
==============================================================================
--- (empty file)
+++ branches/rel-1/testing/Duncan/pyrex/test1.pyx Sun Oct 14 13:06:48 2007
@@ -0,0 +1,20 @@
+#
+# Defining an extension type
+#
+
+cdef class Spam:
+
+ cdef int amount
+
+ def __cinit__(self):
+ self.amount = 0
+
+ def get_amount(self):
+ return self.amount
+
+ def set_amount(self, new_amount):
+ self.amount = new_amount
+
+ def describe(self):
+ print self.amount, "tons of spam!"
+
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog