It is not required to use Notepad++ for this course. It is one IDE you may use for coding assignments.
This article explains one method to configure Notepad++ to easily run Python programs you have coded in the IDE.
There are multiple ways to configure Notepad++ to execute or run Python programs. Another in-depth solution is explained here.
A very simple method is to add a Run command directly to Notepad++, using the following steps:
- Determine where the Python engine is installed.
- Use the Notepad++ Run menu to add and name a run command
- Assign a shortcut key to call the new run command
Make sure Python is already installed and working correctly.
Determine where Python is installed. Open a command window (for example, using Windows-Key + R and type cmd [enter]). In the Command window, type
The result should look something like this:
Copy the path where Python is located into the clipboard (CTRL-C).
Open Notepad++. Click Run on the menu. Click Run at the top of the context menu.
Paste the Python path (from above) in the text box under "The Program to Run".
At the end of the path, add the following text exactly as displayed, with quotation marks: -i "$(FULL_CURRENT_PATH)"
The full command should look something like this (this is using my path for Python):
In the next dialog box, give the Shortcut a name (such as "runPython"), and
set a shortcut key (such as F6 or F9...). Click [OK].
Your custom run command should now be set. Code a short Python program or open a Python file in Notepad++. Click your shortcut key to run the
For example, this simple program will display a welcome message:
myName = "David Marrero"
print ("Welcome! " + myName)
Make sure to click File/Save As on the menu, or press [ CTRL-S ]. Once the program is saved, click your shortcut key to run Python from Notepad++.
This should open a separate command window and run your program in Python.
Close the command window to continue editing your program.