Run a Python program using notepad++ editing
notepad++ is an open source text editor that is powerful and easy to use. Edit and debug Python programs use what editor or IDE different people have different views. Vim or Emacs users can naturally ignore other editors without considering debugging tools, but using an editor such as notepad++ is a good choice in a Windows environment.
tab length and Space conversion
Because Python is strictly required for indentation, we set the tab to 4 spaces and modify it in "Set-> Preferences-> Edit-> Tab Settings".
Syntax highlighting
As long as the extension is set correctly, notepad++ automatically recognizes the language and makes syntax highlighting. If you are not satisfied with the highlighted color or font, you can modify it in the settings, language formatting settings.
Auto-complete
notepad++ also provides automatic completion and input prompts, which you can set in Backup and AutoComplete, preferences, settings. The files required for the automatic completion of Python are brought in at the time of installation and stored in the "Your_npp_dir\plugins\apis" (see Official faq:auto-completion). The default shortcuts are Ctrl+space and Ctrl+enter, which may conflict with the input method's shortcut keys, but all the shortcuts for notepad++ can be customized.
Run the program
Click "Run-> Run" (the default shortcut is F5) and enter it in the popup menu:
Cmd/k C:\Python30\python.exe "$ (Full_current_path)" & PAUSE & EXIT
Choose "Save", you can set a shortcut to this command and a name, such as "Runpython". Run directly by customizing the shortcut keys later on. Note If you want to modify this shortcut, you can modify it in the "Set-> Management shortcut->runcommands". There are a few other notes:
- If you want to modify this command, currently only by modifying the Shortcuts.xml file, this file is saved in the notepad++ configuration file, may be in the notepad++ directory, may also be under Documents and Settings ApplicationData inside.
- The meaning of $ (full_current_path) is the full path to the current file, which is the macro definition of notepad++, note that you enclose it in quotation marks to prevent spaces in the middle of the path.
- The direct execution of the Python.exe is automatically closed at the end of the run, so use CMD to execute. (The Python 2.5 seems different, but 3.0 requires this setting.) )
- The meaning of cmd/k is to execute the following command, and to keep the window after execution is complete. & is to connect multiple commands. Pause indicates that the end of the run is paused and waits for an arbitrary key. EXIT indicates that the command-line window is closed. If you use CMD/C, you can dispense with EXIT.
Pthon execution mode in notepad++