Ask Your Question
1

Where is the default directory for outputting?

asked 2012-10-08 20:09:38 +0100

updated 2012-10-08 20:35:42 +0100

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.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2012-10-09 11:45:41 +0100

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.

edit flag offensive delete link more

Comments

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

jlv gravatar imagejlv ( 2012-10-09 21:25:39 +0100 )edit
0

answered 2012-10-08 22:07:06 +0100

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.

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: 2012-10-08 20:09:38 +0100

Seen: 1,191 times

Last updated: Oct 09 '12