#8478: Programming tutorial page seems incorrect
-----------------------------+----------------------------------------------
Reporter: lesshaste | Owner: mvngu
Type: defect | Status: new
Priority: major | Milestone:
Component: documentation | Keywords:
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
-----------------------------+----------------------------------------------
The section Standalone Python/Sage Scripts at
http://www.sagemath.org/doc/tutorial/programming.html#section-loadattach
seems to have two problems (profuse apologies if these are actually user
errors).
1) #!/usr/bin/env sage -python doesn't work in linux as shebang can't
take two arguments. One simple workaround is to use #!/path_to_sage
-python
2) The script itself seems broken. Testing it using sage 4.3.3
./factor 2006
works as expected.
But ./factor "32*x^5-1" gives
Traceback (most recent call last):
File "./factor", line 11, in <module>
print factor(sage_eval(sys.argv[1]))
File "/opt/sage-4.3.3-linux-32bit-
ubuntu_9.10-i686-Linux/local/lib/python2.6/site-
packages/sage/misc/sage_eval.py", line 199, in sage_eval
return eval(source, sage.all.__dict__, locals)
File "<string>", line 1, in <module>
NameError: name 'x' is not defined
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8478>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
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-trac?hl=en.