title: Correct way to launch and close interactive ipython session from notepad++
body: <p>What I would like to do is launch an interactive ipython session from notepad++, and keep the window open (in interactive mode) after a script completes, but for the window to close once I exit from ipython. This seems like a fairly simple task, but I'm having trouble finding the answer. </p>
  
  <p>In notepad++, I have entered the following for the <code>Run</code> command (<code>F5</code>): </p>
  
  <pre><code>cmd /k ipython -i "$(FULL_CURRENT_PATH)"
  </code></pre>
  
  <p>This works fine: it opens and runs the script I am editing using ipython, and keeps the ipython session open once the script is complete. </p>
  
  <p>However, after entering the <code>exit</code> command, I have to enter <code>exit</code> a second time at the command prompt) to close the window (or close it with the mouse). It would be nice if I didn't have to enter <code>exit</code> twice. Is there a solution to get things working the way I want them to work? </p>
  
  <p>I have tried removing <code>/k</code> flag (my understanding is this flag keeps the window open): </p>
  
  <pre><code>cmd ipython -i "$(FULL_CURRENT_PATH)"
  </code></pre>
  
  <p>However, the script does not seem to run at all in this case. </p>