How to Configure Notepad++ to run a python script via python IDLE
If you are learning python and want to use notepad++ as a free as well as simple and easy to use editor, follow these simple steps:
Install python (2.x/3.x)
(this example was made for python 2.7)
First thing: Download the python 2.x/3.x windows installer from http://www.python.org/download/ using the default settings. It should install python in the folder: C:\Python27. You can use a different version of python, just substitute out the version number wherever you see 27.
Install Notepad++
Download and install the Notepad++ installer from http://notepad-plus-plus.org/download
Run the installer using the default settings for everything.
Open Notepad++
Configure Notepad++ to run a python script
- Open notepad ++
- Click run > run or press F5
- In the “program to run” dialog box press the three dots (…) and navigate to C:\Python27\Lib\idlelib\idle.py (or change C: to your python installation drive)
- Than add “$(FULL_CURRENT_PATH)” after the py so that the line will look like this:
Python 2
C:\Python27\Lib\idlelib\idle.py “$(FULL_CURRENT_PATH)”
Python 3
C:\Program Files (x86)\Python36-32\Lib\idlelib\idle.py “$(FULL_CURRENT_PATH)”
- Click ‘save and give the shortcut a name like ‘python IDLE’
- You can also select a shortcut, for example”: Alt+shift+p
- Click OK
- Click run
- A new notepad window will open. (you can minimize the black command line window)
- hit F5 and the python shell will now open
- In the notepad window, write your code Save as ‘example.py’
- hit F5
- Now, every time you test your modified code, you will be prompted to save the file. When hit F5 the code will run on the python command line shell, it is a very convenient way to code and simultaneously see your code run.
I just have typed $(FULL_CURRENT_PATH) and it works. Thank you.
If you have added python to path you can simpy put
python $(FULL_CURRENT_PATH)
and that works
As of May 2019 (with Notepad++ 7.6.6), copy/pasting this advice can cause “ShellExecute – ERROR”. Please replace smart quotes with normal ASCII “quote marks” in the examples above. In any path that includes a space (like in the python3 example), you need to surround that path with quotes as well.
Thanks peter. I will check this out.
brilliant!