Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

save and load in SAGE


In my case, I am using SAGE in my macbook.

For example...

At first, I make file.sage file.

def plus_one(number):
  return number+1

In terminal, I go to the folder which has file.sage and enter SAGE

And then I load file by using the below command.

sage: load("file.sage")

After some calculations, I make L.

sage: L=[]
sage: for i in range(10):
sage:   L=L+[a+plus_one(i)]

My question is how can I save L in some file like file.sage.

file.sage is editable in another editors, easily.

It is almost same as ordinary text file.

But if I use the command save(L, "file") then file.sobj file appears. I don't know how do I edit that file.

In that case, if I want to change value of before variables then... it is uncomfortable.

Is there any good way to save some datas?