Ask Your Question
1

save and load

asked 2011-10-28 09:05:11 +0200

emiliocba gravatar image

I have an algorithm which has a list of size 10^6 as output. I would like to run this program in one fast computer and then to upload this list and work in my compute. Can I do this? Have I to save the list as text?

Thanks.-.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2011-10-28 09:59:21 +0200

kcrisman gravatar image

Nope, and great question! Here is how you do it.

sage: L = [n^2 for n in range(10^6)]
sage: len(L)
1000000
sage: save(L,'my_long_list')

Now I quit Sage, and restart, and...

----------------------------------------------------------------------
| Sage Version 4.7.1, Release Date: 2011-08-11                       |
| Type notebook() for the GUI, and license() for information.        |
----------------------------------------------------------------------
sage: L = load('my_long_list.sobj')
sage: len(L)
1000000

Of course, this would work if you sent the file to another computer as well. See this part of the tutorial for more details.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2011-10-28 09:05:11 +0200

Seen: 4,879 times

Last updated: Oct 28 '11