Changing data.sage to

T[0]=([1, 2, 3, 4], [5, 6, 7], [8, 9, 10, 11], [13, 14])
T[1]=([1, 2, 3, 4], [5, 6, 7], [12], [13, 14])

gives the error

NameError: name 'T' is not defined

On Jun 5, 6:18 pm, wkehowski <wkehow...@cox.net> wrote:
> File data.sage (without #):
>
> ##
> T(0)=([1, 2, 3, 4], [5, 6, 7], [8, 9, 10, 11], [13, 14])
> T(1)=([1, 2, 3, 4], [5, 6, 7], [12], [13, 14])
> ##
>
> File test.sage:
>
> ##
> load "data.sage"
>
> for x in T(0): print x
> ##
>
> gives the error message:
>
> ##
> TypeError:
> WARNING: Failure executing file: </home/user/.sage/temp/ubuntu/5399/
> _home_user_temp_test_sage_0.py>
> ##
>
> What is the problem?
>
> Thanks in advance.
>
> Walter Kehowski
>
> On Jun 5, 12:42 pm, wkehowski <wkehow...@cox.net> wrote:
>
> > Hello,
>
> > I would like to create a file T.sage or T.txt, say, with lines like
>
> > T(0)=(1,2,3,4)
> > T(1)=(5,6,7,8)
>
> > or possibly
>
> > T(0)=((1,2),(3,4),(5))
> > T(1)=((6,7),(8,9),(10))
>
> > (or each line just a tuple or tuple of tuples, etc.)
>
> > and be able consider this as defining T as function from range(0..q)
> > to tuples(or lists) by inserting in some other file F.sage, say, a
> > line like
>
> > load "T.sage"
>
> > or using open, readlines(), and close() on T.txt  . Can this be done?
>
> > Thanks in advance,
>
> > Walter Kehowski
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to