Ask Your Question
0

How can I stop sagemath program without quitting sage session?

asked 2017-02-16 02:59:25 -0600

prosolver gravatar image

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?

edit retag flag offensive close merge delete

Comments

2

To cancel the current calculation, hit control-c. Does that do what you want?

John Palmieri gravatar imageJohn Palmieri ( 2017-02-16 12:15:44 -0600 )edit

Thank you! It works! I did not know that there is such a simple solution.

prosolver gravatar imageprosolver ( 2017-02-17 00:02:32 -0600 )edit

Well, 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.

eric_g gravatar imageeric_g ( 2017-02-18 03:51:34 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2017-02-16 04:14:47 -0600

eric_g gravatar image

I 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.

edit flag offensive delete link more

Comments

I 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!

prosolver gravatar imageprosolver ( 2017-02-17 00:03:34 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-02-16 02:59:25 -0600

Seen: 48 times

Last updated: Feb 16