Ask Your Question

Viewing variables in memory

asked 2013-11-15 03:06:23 +0200

jaia gravatar image

Does Sage provide any way to see which variables and user-defined functions are currently in memory, like the ls() command in R?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-11-15 04:51:54 +0200

gundamlh gravatar image
sage: a,b,c,d = var('a,b,c,d')
sage: who
a       b       c       d
sage: whos
Variable   Type          Data/Info
a          Expression    a
b          Expression    b
c          Expression    c
d          Expression    d

Is it what you want?

edit flag offensive delete link more


Yes, but it's not working on my system (Sage 5.12 running on Ubuntu 13.10.) I just get a name error.

jaia gravatar imagejaia ( 2013-11-15 13:06:18 +0200 )edit

Sorry, I have no idea about that.. my sage: 'Sage Version 5.10, Release Date: 2013-06-17' on openSuSE 12.3

gundamlh gravatar imagegundamlh ( 2013-11-15 14:00:57 +0200 )edit

This is not a question of versions, `who` and `whos` are specific to ipython (the command line), they do not work in the notebook.

tmonteil gravatar imagetmonteil ( 2013-11-16 17:52:40 +0200 )edit

That would be a great feature to have. I can definitely see using it to debug student (and my own) code.

jaia gravatar imagejaia ( 2013-11-17 04:14:50 +0200 )edit

Your Answer

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

Add Answer

Question Tools


Asked: 2013-11-15 03:06:23 +0200

Seen: 685 times

Last updated: Nov 15 '13