On 8-Jul-08, at 9:36 AM, ibrahim wrote: > > I don't know anything about python.
If you know nothing about Python, I think you will have a very difficult time wrapping C++ code using Cython and Sage. > As they said than Sage is a python interpreter, > I just try to load the file into Sage directly. > > When I try to import it into python, I have a syntax error: > >>>> import "~/.sage/rectangle/setup.pyx" > File "<stdin>", line 1 > import "~/.sage/rectangle/setup.pyx" > ^ > SyntaxError: invalid syntax The import statement imports modules, either .py or compiled .pyx. So if you have a test.py, you can use "import test"; if you have a test.pyx, you compile it (and get a test.so or similar) and still use "import test". If you want to have Sage do the compiling for you, say from the sage: prompt, try: sage: load "myfile.pyx" Nick --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---