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.Fri, 24 Feb 2017 17:00:46 +0100How can I stop sagemath program without quitting sage session?https://ask.sagemath.org/question/36640/how-can-i-stop-sagemath-program-without-quitting-sage-session/Hello. First of all, I think it is good to describe how I use SageMath before asking the question.
I installed SageMath in my laptop using Ubuntu 16.04.
It is installed in directory "~/sage".
I usually run SageMath in terminal. That is, I follow the following steps to run SageMath.
1. Open the terminal (It is the basic terminal from Ubuntu 16.04).
2. Go to the directory where SageMath is installed by typing "cd sage".
3. Type "./sage".
Then, sage session begins.
In sage session, I usually load a sage file which I already wrote and run it to check the result.
But sometimes, a program does not seem to finish, since computation takes a lot of time.
Then, I would like to finish the program which I am running now, but *without going out of sage session*,
since otherwise, I should follow 3 steps above again.
However, I could not find how to do it, yet.
Can anybody teach me how to do it?Thu, 16 Feb 2017 09:59:25 +0100https://ask.sagemath.org/question/36640/how-can-i-stop-sagemath-program-without-quitting-sage-session/Comment by John Palmieri for <p>Hello. First of all, I think it is good to describe how I use SageMath before asking the question.</p>
<p>I installed SageMath in my laptop using Ubuntu 16.04.
It is installed in directory "~/sage".
I usually run SageMath in terminal. That is, I follow the following steps to run SageMath.</p>
<ol>
<li>Open the terminal (It is the basic terminal from Ubuntu 16.04).</li>
<li>Go to the directory where SageMath is installed by typing "cd sage".</li>
<li>Type "./sage".
Then, sage session begins.</li>
</ol>
<p>In sage session, I usually load a sage file which I already wrote and run it to check the result.
But sometimes, a program does not seem to finish, since computation takes a lot of time.
Then, I would like to finish the program which I am running now, but <em>without going out of sage session</em>,
since otherwise, I should follow 3 steps above again.
However, I could not find how to do it, yet.</p>
<p>Can anybody teach me how to do it?</p>
https://ask.sagemath.org/question/36640/how-can-i-stop-sagemath-program-without-quitting-sage-session/?comment=36643#post-id-36643To cancel the current calculation, hit control-c. Does that do what you want?Thu, 16 Feb 2017 19:15:44 +0100https://ask.sagemath.org/question/36640/how-can-i-stop-sagemath-program-without-quitting-sage-session/?comment=36643#post-id-36643Comment by prosolver for <p>Hello. First of all, I think it is good to describe how I use SageMath before asking the question.</p>
<p>I installed SageMath in my laptop using Ubuntu 16.04.
It is installed in directory "~/sage".
I usually run SageMath in terminal. That is, I follow the following steps to run SageMath.</p>
<ol>
<li>Open the terminal (It is the basic terminal from Ubuntu 16.04).</li>
<li>Go to the directory where SageMath is installed by typing "cd sage".</li>
<li>Type "./sage".
Then, sage session begins.</li>
</ol>
<p>In sage session, I usually load a sage file which I already wrote and run it to check the result.
But sometimes, a program does not seem to finish, since computation takes a lot of time.
Then, I would like to finish the program which I am running now, but <em>without going out of sage session</em>,
since otherwise, I should follow 3 steps above again.
However, I could not find how to do it, yet.</p>
<p>Can anybody teach me how to do it?</p>
https://ask.sagemath.org/question/36640/how-can-i-stop-sagemath-program-without-quitting-sage-session/?comment=36645#post-id-36645Thank you! It works! I did not know that there is such a simple solution.Fri, 17 Feb 2017 07:02:32 +0100https://ask.sagemath.org/question/36640/how-can-i-stop-sagemath-program-without-quitting-sage-session/?comment=36645#post-id-36645Comment by eric_g for <p>Hello. First of all, I think it is good to describe how I use SageMath before asking the question.</p>
<p>I installed SageMath in my laptop using Ubuntu 16.04.
It is installed in directory "~/sage".
I usually run SageMath in terminal. That is, I follow the following steps to run SageMath.</p>
<ol>
<li>Open the terminal (It is the basic terminal from Ubuntu 16.04).</li>
<li>Go to the directory where SageMath is installed by typing "cd sage".</li>
<li>Type "./sage".
Then, sage session begins.</li>
</ol>
<p>In sage session, I usually load a sage file which I already wrote and run it to check the result.
But sometimes, a program does not seem to finish, since computation takes a lot of time.
Then, I would like to finish the program which I am running now, but <em>without going out of sage session</em>,
since otherwise, I should follow 3 steps above again.
However, I could not find how to do it, yet.</p>
<p>Can anybody teach me how to do it?</p>
https://ask.sagemath.org/question/36640/how-can-i-stop-sagemath-program-without-quitting-sage-session/?comment=36654#post-id-36654Well, sometimes `control-c` in a terminal terminates the sage session as well (with "core dumped"). In my experience, interrupting the Jupyter kernel has not this drawback.Sat, 18 Feb 2017 10:51:34 +0100https://ask.sagemath.org/question/36640/how-can-i-stop-sagemath-program-without-quitting-sage-session/?comment=36654#post-id-36654Comment by John Palmieri for <p>Hello. First of all, I think it is good to describe how I use SageMath before asking the question.</p>
<p>I installed SageMath in my laptop using Ubuntu 16.04.
It is installed in directory "~/sage".
I usually run SageMath in terminal. That is, I follow the following steps to run SageMath.</p>
<ol>
<li>Open the terminal (It is the basic terminal from Ubuntu 16.04).</li>
<li>Go to the directory where SageMath is installed by typing "cd sage".</li>
<li>Type "./sage".
Then, sage session begins.</li>
</ol>
<p>In sage session, I usually load a sage file which I already wrote and run it to check the result.
But sometimes, a program does not seem to finish, since computation takes a lot of time.
Then, I would like to finish the program which I am running now, but <em>without going out of sage session</em>,
since otherwise, I should follow 3 steps above again.
However, I could not find how to do it, yet.</p>
<p>Can anybody teach me how to do it?</p>
https://ask.sagemath.org/question/36640/how-can-i-stop-sagemath-program-without-quitting-sage-session/?comment=36722#post-id-36722@eric_g: this usually indicates a bug: a core dump should not happen. If it is repeatable, or at least somewhat repeatable, you should report the issue so it can be fixed.Fri, 24 Feb 2017 17:00:46 +0100https://ask.sagemath.org/question/36640/how-can-i-stop-sagemath-program-without-quitting-sage-session/?comment=36722#post-id-36722Answer by eric_g for <p>Hello. First of all, I think it is good to describe how I use SageMath before asking the question.</p>
<p>I installed SageMath in my laptop using Ubuntu 16.04.
It is installed in directory "~/sage".
I usually run SageMath in terminal. That is, I follow the following steps to run SageMath.</p>
<ol>
<li>Open the terminal (It is the basic terminal from Ubuntu 16.04).</li>
<li>Go to the directory where SageMath is installed by typing "cd sage".</li>
<li>Type "./sage".
Then, sage session begins.</li>
</ol>
<p>In sage session, I usually load a sage file which I already wrote and run it to check the result.
But sometimes, a program does not seem to finish, since computation takes a lot of time.
Then, I would like to finish the program which I am running now, but <em>without going out of sage session</em>,
since otherwise, I should follow 3 steps above again.
However, I could not find how to do it, yet.</p>
<p>Can anybody teach me how to do it?</p>
https://ask.sagemath.org/question/36640/how-can-i-stop-sagemath-program-without-quitting-sage-session/?answer=36641#post-id-36641I don't know how to do this in a terminal, but if you run SageMath in a Jupyter notebook (i.e. use `./sage -n jupyter`), you can stop the execution of the code and keep your session by selecting `Interrupt` in the `Kernel` menu.Thu, 16 Feb 2017 11:14:47 +0100https://ask.sagemath.org/question/36640/how-can-i-stop-sagemath-program-without-quitting-sage-session/?answer=36641#post-id-36641Comment by prosolver for <p>I don't know how to do this in a terminal, but if you run SageMath in a Jupyter notebook (i.e. use <code>./sage -n jupyter</code>), you can stop the execution of the code and keep your session by selecting <code>Interrupt</code> in the <code>Kernel</code> menu.</p>
https://ask.sagemath.org/question/36640/how-can-i-stop-sagemath-program-without-quitting-sage-session/?comment=36646#post-id-36646I haven't used a Jupyter notebook yet, but it seems that it is a good way to use SageMath. I will try.
Thank you for your answer!Fri, 17 Feb 2017 07:03:34 +0100https://ask.sagemath.org/question/36640/how-can-i-stop-sagemath-program-without-quitting-sage-session/?comment=36646#post-id-36646