title: IPython: Running commands asynchronously in the background
body: <p>Say I have a <strong>Python command or script</strong> that I want to run from IPython asynchronously, in the background, during an IPython session. </p>
  
  <p>I would like to invoke this command from my IPython session and be notified when it is done, or if something fails. I don't want this command to block my IPython prompt.</p>
  
  <p>Are there any <strong>IPython magics</strong> that support this?  If not, what is the recommended way of running asynchronous jobs/scripts/commands (that run locally) on IPython?</p>
  
  <p>For example, say I have a function:</p>
  
  <pre><code>def do_something():
     # This will take a long time
     # ....
     return "Done"
  </code></pre>
  
  <p>that I have in the current namespace. How I can I run it to the background and be notified when it is done?</p>