Configure Notepad++ to run a python script
Install python (2.7.4) #
Download the python 2.7.4 windows installer from http://www.python.org/download/
Run through the installer using the default settings for everything. It should install python in the folder: C:\Python27. If you’re using a different version of python, just substitute out the version number wherever you see 27.
Install Notepad++ #
From http://notepad-plus-plus.org/download, download the Notepad++ installer.
Run through the installer using the default settings for everything.
Configure Notepad++ to run a python script #
- Open up a command prompt
- Run the following command:
Note: If your version of python was installed in a different location, make sure to substitute out that location with the one in the command.
You can use the following command to make sure the python path was added to the PATH variable:
You should see the location of the python directory at the end of the output.
Switch back to Notepad++, and go up to the menu bar, select Run, and then select Run… (F5)
Insert the following in the text box that appears:
C:\Python27\python.exe -i "$(FULL_CURRENT_PATH)"
Configure CTRL+R to be the command. Give it a name, and press OK.
Now whenever you want to run the python script you’re working on, press CTRL+R and it will be executed. Also you should see the window stay opened after command execution for debugging purposes because of the -i flag. Remove it if you don’t want that feature.