ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 09 Oct 2012 21:25:39 +0200Where is the default directory for outputting?https://ask.sagemath.org/question/9404/where-is-the-default-directory-for-outputting/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.Mon, 08 Oct 2012 20:09:38 +0200https://ask.sagemath.org/question/9404/where-is-the-default-directory-for-outputting/Answer by kcrisman for <p>So I'm running Sage on OSX, and I'm using the function <code>g.write_to_eps()</code>, where g is a graph. One from the sage help pages is</p>
<pre><code> 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]})
</code></pre>
<p>So I run that, then <code>g.write_to_eps('sage.eps')</code>, 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/'</p>
<p>Thanks!</p>
<p>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 <code>g.write_to_eps('/Users/jlv/Desktop/sage.eps')</code> appears on my Desktop.</p>
https://ask.sagemath.org/question/9404/where-is-the-default-directory-for-outputting/?answer=14122#post-id-14122It 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.Mon, 08 Oct 2012 22:07:06 +0200https://ask.sagemath.org/question/9404/where-is-the-default-directory-for-outputting/?answer=14122#post-id-14122Answer by John Palmieri for <p>So I'm running Sage on OSX, and I'm using the function <code>g.write_to_eps()</code>, where g is a graph. One from the sage help pages is</p>
<pre><code> 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]})
</code></pre>
<p>So I run that, then <code>g.write_to_eps('sage.eps')</code>, 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/'</p>
<p>Thanks!</p>
<p>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 <code>g.write_to_eps('/Users/jlv/Desktop/sage.eps')</code> appears on my Desktop.</p>
https://ask.sagemath.org/question/9404/where-is-the-default-directory-for-outputting/?answer=14125#post-id-14125From 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.
Tue, 09 Oct 2012 11:45:41 +0200https://ask.sagemath.org/question/9404/where-is-the-default-directory-for-outputting/?answer=14125#post-id-14125Comment by jlv for <p>From the notebook, evaluate the variable <code>DATA</code>; you'll get something like</p>
<pre><code>'/Users/jlv/.sage/sage_notebook.sagenb/home/admin/42/data/'
</code></pre>
<p>(although probably with a different number than "42"). It looks to me as though the output directory for <code>write_to_eps</code> is obtained by replacing <code>data</code> with <code>cells</code>, or actually a subdirectory of</p>
<pre><code>'/Users/jlv/.sage/sage_notebook.sagenb/home/admin/42/cells/'
</code></pre>
<p>Because of this, from the notebook, I often specify a full path when outputting: <code>g.write_to_eps('/Users/jlv/Desktop/sage.eps')</code>, for example.</p>
https://ask.sagemath.org/question/9404/where-is-the-default-directory-for-outputting/?comment=18913#post-id-18913Indeed, DATA was key. I can even see plots as .png files there! Super.Tue, 09 Oct 2012 21:25:39 +0200https://ask.sagemath.org/question/9404/where-is-the-default-directory-for-outputting/?comment=18913#post-id-18913