Exit the core in math with a team that does not use the Grade menu

I would like that, when evaluating a laptop, it first leaves the last local kernel, and then starts the local core again. Is there a command for this without using the Grade menu in Mathematica?

+4
source share
2 answers

Quit[] can be used to complete the kernel, and then everything that is evaluated in the notebook will start it again.


If the reason you want to do this is to make sure that what is running on the laptop does not conflict with previously defined characters, you can set the menu instead:

 Evaluation > Notebook Default Context > Unique to This Notebook 

If you want Quit[] to set the kernel often, then you may need to adjust the keyboard shortcut. For this see this answer:

Customizing Mathematica Shortcuts


If you find that Mathematica slows down in the middle of processing a long laptop, and the last parts of this laptop are independent of the previous parts, you can paste this at the beginning of your laptop:

 Needs["Utilities`CleanSlate`"] 

and then paste:

 CleanSlate[] 

where the Quit[] effect is required Quit[]

+6
source

The only solution I can offer is to use the slave kernel through MathLink . It allows you to restart the slave kernel whenever you wish, and make additional rules when it is restarted automatically. Of course, the main kernel will not be restarted and will be used as an interface for the slave kernel. You can find general ideas for this in this thread .

0
source

All Articles