Saturday, January 1, 2011

Python in Notepad++

UPDATE: It's easier to follow the advice in the comments.

Here's the command I added to Notepad++'s "settings.xml" to allow me to run python scripts from the program:

<command name="Python 3.1" ctrl="yes" alt="no" shift="no" key="116">cmd /k C:\Python31\python.exe "$(FULL_CURRENT_PATH)"</command>

cmd /k opens a command window and keeps it open so you can see the output.

There's a settings.xml in the Notepad install directory, then also one in C:\Users\(username)\AppData\Roaming\Notepad++\

I think the latter is the one where you want to toss this in, right at the end of the list of "UserDefinedCommands." This sets it to ctrl+F5, you can adjust this easily (without memorizing all the key codes) by just opening Notepad++ after the command is loaded, then Run -> Modify shortcut.