Hi Brandon,

You are getting the error since the scripts ending in .py are not
preparsed.  For example, the integer 104 is a Python integer.  The
Sage interpreter wraps it with a Integer() so that it becomes a Sage
integer.  To see this, try

sage: preparse('vector(104, 1117, 386])')

It's one of those things that you need keep in mind when writing
Python scripts that use Sage.  An alternative would be to write a
vectest.sage file which would get preparsed.

--Mike

On 1/3/08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> [EMAIL PROTECTED]/JC% cat vectest.py
> #!/bin/env sage
> import sys
> from sage.all import *
>
> vector([104, 1117, 386])
> [EMAIL PROTECTED]/JC% ./vectest.py
>
> Traceback (most recent call last):
>  File "./vectest.py", line 5, in <module>
>    vector([104, 1117, 386])
>  File "free_module_element.pyx", line 230, in
> sage.modules.free_module_element.vector
>  File "free_module_element.pyx", line 243, in
> sage.modules.free_module_element.prepare
> TypeError: unable to find a common ring for all elements
> sage: Error running ./vectest.py using Python
> [EMAIL PROTECTED]/JC%
> [EMAIL PROTECTED]/JC% sage -version
> | SAGE Version 2.9.1.1, Release Date: 2007-12-25                     |
> [EMAIL PROTECTED]/JC% sage
> ----------------------------------------------------------------------
> | SAGE Version 2.9.1.1, Release Date: 2007-12-25                     |
> | Type notebook() for the GUI, and license() for information.        |
> ----------------------------------------------------------------------
>
> sage: vector(list((104, 1117, 386)))
> (104, 1117, 386)
>
> PS: not my system ;-)
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to