Pthon execution mode in notepad++

Source: Internet
Author: User

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:

    1. 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.
    2. 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.
    3. 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.) )
    4. 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++

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.