Re: [sage-support] passing variables from one worksheet to the other

15 views
Skip to first unread message

William Stein

unread,
Apr 4, 2013, 12:36:10 AM4/4/13
to sage-s...@googlegroups.com
On Wed, Apr 3, 2013 at 6:50 PM, evren <baris...@gmail.com> wrote:
> Hi everyone,
>
> I use sage online. How can I pass variables from one worksheet to the other? For instance, if I have a matrix in one worksheet, how do I transfer it to another worksheet?
>

You could save it to /tmp, e.g., something link

save(m, '/tmp/a.sobj') # in one


m = load('/tmp/a.sobj') # in the other

William
> Evren
>
> --
> You received this message because you are subscribed to the Google Groups "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.
> To post to this group, send email to sage-s...@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-support?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



--
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

Volker Braun

unread,
Apr 4, 2013, 5:07:40 AM4/4/13
to sage-s...@googlegroups.com
Alternatively, if its a small enough matrix, use sage_input() and copy&paste:

sage: m = random_matrix(ZZ,3)
sage: m
[ 1 -1 -1]
[ 3  0  6]
[41  2 10]
sage: sage_input(m)
matrix(ZZ, [[1, -1, -1], [3, 0, 6], [41, 2, 10]])

evren

unread,
Apr 4, 2013, 9:21:05 AM4/4/13
to sage-s...@googlegroups.com
Professor Stein,

Is it possible to save more than one variable at a time to \tmp?

Best,

Evren

evren

unread,
Apr 4, 2013, 9:21:58 AM4/4/13
to sage-s...@googlegroups.com
Thanks!

Evren

William Stein

unread,
Apr 4, 2013, 10:06:07 AM4/4/13
to sage-support support


On Apr 4, 2013 6:21 AM, "evren" <baris...@gmail.com> wrote:
>
> Professor Stein,
>
> Is it possible to save more than one variable at a time to \tmp?
>

Yes - use multiple files or put multiple variables together in a list...

Reply all
Reply to author
Forward
0 new messages