As of this writing (December 2019) the warning dialog you are inquiring about still exists. The simplest way to "bypass" this warning is to close the plot before you rerun your code (regardless of the steps presented below).
An "Automatic" Solution
Note: These steps assume you are running Notepad++ on Windows.
As an alternative to simply closing the plot manually each time, in NppExec you should be able to run e.g.:
TASKKILL /F /IM python.exe
CMD /C START "" /MIN python "$(FULL_CURRENT_PATH)"
You should have a look at TASKKILL, CMD and START respectively for detailed explanations of the options for each command, but in essence these commands kill any existing python.exe
processes then spawn another set of processes that are decoupled from NppExec/Notepad++ (so they don't need to be terminated before running a new set of processes again).
As a small caveat, this won't prevent the warning with any pre-existing windows. You will still need to close them manually first.
"$(FULL_CURRENT_PATH)"
is a built-in Notepad++ variable and requires that the current document have an existing path (i.e. it's been saved) to work correctly. Otherwise, you can just use the full path to your code (e.g. C:\path\to\code.py
).