This question already has an answer here:
- How to Execute a Python File in Notepad ++? 17 answers
When I'm using textmate, I simply hit "apple+r" and the program gets interpreted. How can I run a program from within notepad++? I see that F5 is for "Run", but pointing that to Python.exe simply opens up a terminal with python running. It does not run my script.
You can use PyNPP Plugin (https://github.com/mpcabd/PyNPP) to achieve this.
I know this is old but the answer is for people coming from search.
You need to pass through the FULL_CURRENT_PATH environment variable to the program, as described in the notepad++ wiki:
Unless I'm missing something, the other answers discussing NppExec do not provide a way to run the script with a single keystroke or (the execute dialogue box always pops up when F6 is pressed which must be accepted before the script is run).
After completing the steps in bjornhb's answer the following will allow you to run scripts with just one keystroke:
possible to use pdb too
The answers above were very useful to get it working. However, once i could run the python programs, I also needed to interact with them. Two things I found out.
Plugins NppExec Execute (F6) is much more powerful than plain Run (F5). Install NppExec via Plugins, Plugin Manager. Then in F6 add/save the following:
In Plugins NppExec Console output filters (Shift+F6) add the following HighLight mask:
Make sure it's checked, and make it e.g. red and underlined.
Upon "F6/execute" errors will be highlighted and clickable !
This works in NPP568, possibly older.
if u have the NppExec plugin (is by default) hit F6 and add the command that exec your script