Ask Your Question
1

Where is the default directory for outputting?

asked 12 years ago

updated 12 years ago

So I'm running Sage on OSX, and I'm using the function g.write_to_eps(), where g is a graph. One from the sage help pages is

 g = Graph({0:[6,7],1:[7,8],2:[8,9],3:[9,10],4:[10,11],5:[11,6],6:[0,5,7],7:[0,1,6],8:[1,2,9],9:[2,3,8],10:[3,4,11],11:[4,5,10]})

So I run that, then g.write_to_eps('sage.eps'), but I have no idea where it is supposed to show up. Could anybody help me with this? Probably a very easy answer, but I couldn't find a solid reply through Google. Sage is located in '/Applications/sage' and I'm in '/Users/jlv/'

Thanks!

P.S. To be more precise, where is the output executing the above commands from the browser notebook, not Terminal. Through Terminal things work as they should, as in g.write_to_eps('/Users/jlv/Desktop/sage.eps') appears on my Desktop.

Preview: (hide)

2 Answers

Sort by » oldest newest most voted
1

answered 12 years ago

From the notebook, evaluate the variable DATA; you'll get something like

'/Users/jlv/.sage/sage_notebook.sagenb/home/admin/42/data/'

(although probably with a different number than "42"). It looks to me as though the output directory for write_to_eps is obtained by replacing data with cells, or actually a subdirectory of

'/Users/jlv/.sage/sage_notebook.sagenb/home/admin/42/cells/'

Because of this, from the notebook, I often specify a full path when outputting: g.write_to_eps('/Users/jlv/Desktop/sage.eps'), for example.

Preview: (hide)
link

Comments

Indeed, DATA was key. I can even see plots as .png files there! Super.

jlv gravatar imagejlv ( 12 years ago )
0

answered 12 years ago

kcrisman gravatar image

It writes it in whatever directory you are in. When I start in SAGE_ROOT (the Sage folder):

sage: g = Graph({0:[6,7],1:[7,8],2:[8,9],3:[9,10],4:[10,11],5:[11,6],6:[0,5,7],7:[0,1,6],8:[1,2,9],9:[2,3,8],10:[3,4,11],11:[4,5,10]})
sage: g.write_to_eps('sage.eps')
sage: ls
COPYING.txt data@       ipython/    sage.eps
Makefile    devel/      local/      spkg/
README.txt  dochtml.log ptest.log   start.log
VERSION.txt install.log sage*       tmp/

When I start in my home directory I get it there. So wherever you start Sage from, there it is! I guess that seems consistent with your other experience.

Preview: (hide)
link

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: 12 years ago

Seen: 1,222 times

Last updated: Oct 09 '12