Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Set an evaluation to run when the Wolfram Language kernel session is terminated
ResourceFunction["RunOnQuit"][eval] adds eval to a list of evaluations to complete when the current kernel quits. |
Evaluate an expression when the Wolfram Language kernel session is terminated:
In[1]:= |
Out[1]= |
In[2]:= |
Add multiple pieces of code:
In[3]:= |
Out[3]= |
In[4]:= |
Out[4]= |
In[5]:= |
RunOnQuit[expr] is similar to $Epilog := expr, but the file end.m is still read (if available):
In[6]:= |
Out[6]= |
In[7]:= |
Out[7]= |
In[8]:= |
Out[8]= |
Each time RunOnQuit is used, code is prepended to the sequence of evaluations in $Epilog:
In[9]:= |
Out[9]= |
In[10]:= |
Out[10]= |
In[11]:= |
Out[11]= |
In[12]:= |
Out[12]= |
In[13]:= |
If $Epilog is undefined, RunOnQuit[expr] defines it:
In[14]:= |
In[15]:= |
Out[15]= |
In[16]:= |
Out[16]= |
Evaluations will then be prepended as normal:
In[17]:= |
Out[17]= |
In[18]:= |
Out[18]= |
In[19]:= |
Create a notebook that only persists for the current kernel session:
In[20]:= |
Out[20]= |
Make sure you are logged out of the cloud when the kernel quits:
In[21]:= |
Out[21]= |
Clean up any messes that you make:
In[22]:= |
Out[22]= |
In[23]:= |
Out[23]= |
Run all evaluations on quit:
In[24]:= |
Wolfram Language 11.3 (March 2018) or above
This work is licensed under a Creative Commons Attribution 4.0 International License