ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 07 Feb 2013 04:09:56 -0600Can I run SAGE in an editorhttp://ask.sagemath.org/question/9770/can-i-run-sage-in-an-editor/ I was wondering if there is a way to use SAGE in an editor like Komodo. I only know how to run it using the terminal, but then if I want to write a lengthy program in SAGE I have to retype it line by line whenever I make a typo.
Also, can I store definitions I write using the SAGE library to be used later (like in python I could make a module)?
I'm using Python 2.7.2, OSX 10.6.8, Sage version 4.1.1 and I have Komodo Edit version 7.1.3.
Tue, 05 Feb 2013 03:47:01 -0600http://ask.sagemath.org/question/9770/can-i-run-sage-in-an-editor/Comment by eric.c.kangas for <p>I was wondering if there is a way to use SAGE in an editor like Komodo. I only know how to run it using the terminal, but then if I want to write a lengthy program in SAGE I have to retype it line by line whenever I make a typo.</p>
<p>Also, can I store definitions I write using the SAGE library to be used later (like in python I could make a module)?</p>
<p>I'm using Python 2.7.2, OSX 10.6.8, Sage version 4.1.1 and I have Komodo Edit version 7.1.3.</p>
http://ask.sagemath.org/question/9770/can-i-run-sage-in-an-editor/?comment=18296#post-id-18296You can also use a program called cantor.Wed, 06 Feb 2013 03:23:59 -0600http://ask.sagemath.org/question/9770/can-i-run-sage-in-an-editor/?comment=18296#post-id-18296Answer by kcrisman for <p>I was wondering if there is a way to use SAGE in an editor like Komodo. I only know how to run it using the terminal, but then if I want to write a lengthy program in SAGE I have to retype it line by line whenever I make a typo.</p>
<p>Also, can I store definitions I write using the SAGE library to be used later (like in python I could make a module)?</p>
<p>I'm using Python 2.7.2, OSX 10.6.8, Sage version 4.1.1 and I have Komodo Edit version 7.1.3.</p>
http://ask.sagemath.org/question/9770/can-i-run-sage-in-an-editor/?answer=14510#post-id-14510You can use it from Emacs, anyway. See [sage-mode](http://wiki.sagemath.org/sage-mode).
You can definitely make a new module for your own purposes; Sage is basically Python under the hood.
Also, you could in theory do the following (I do this very naive workflow sometimes).
1. Open a Sage file in an editor, called `foo.sage`.
2. Open a Sage session, and use `attach /path/to/foo.sage` to load it up.
3. Make changes in `foo.sage` and save them, in your (still-open) editor.
4. Since you used `attach` and not `load`, the changes should now show up (maybe after hitting return?).
Probably you are looking for something more sophisticated, but this does work.Tue, 05 Feb 2013 04:07:47 -0600http://ask.sagemath.org/question/9770/can-i-run-sage-in-an-editor/?answer=14510#post-id-14510Comment by mcmeekin for <p>You can use it from Emacs, anyway. See <a href="http://wiki.sagemath.org/sage-mode">sage-mode</a>.</p>
<p>You can definitely make a new module for your own purposes; Sage is basically Python under the hood.</p>
<p>Also, you could in theory do the following (I do this very naive workflow sometimes).</p>
<ol>
<li>Open a Sage file in an editor, called <code>foo.sage</code>.</li>
<li>Open a Sage session, and use <code>attach /path/to/foo.sage</code> to load it up.</li>
<li>Make changes in <code>foo.sage</code> and save them, in your (still-open) editor.</li>
<li>Since you used <code>attach</code> and not <code>load</code>, the changes should now show up (maybe after hitting return?).</li>
</ol>
<p>Probably you are looking for something more sophisticated, but this does work.</p>
http://ask.sagemath.org/question/9770/can-i-run-sage-in-an-editor/?comment=18282#post-id-18282Okay great! I will try these things out and I'll post again if I have more questions. Thanks!Thu, 07 Feb 2013 04:09:56 -0600http://ask.sagemath.org/question/9770/can-i-run-sage-in-an-editor/?comment=18282#post-id-18282