Hello,
I have a basic question about using pyrex from a sage script. Suppose
I have a file "test.pyx":
def f(int n):
return n
Then from the sage interpreter I can use it:
sage: load "test.pyx"
Compiling test.pyx...
sage: f(3)
3
But I'd like to use it from a script, e.g. "main.sage":
load "test.pyx"
print f(3)
Then I get:
[EMAIL PROTECTED]:~$ sage main.sage
Traceback (most recent call last):
File "main.py", line 4, in <module>
print f(Integer(3))
NameError: name 'f' is not defined
I tried modifying test.pyx by inserting the word "public" after "def"
but it didn't help. Is there any way of doing this?
Mladen
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-forum
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---