A small improvement of notepad ++ in building a python Development Environment

Source: Internet
Author: User

Notepad ++ is a powerful editor that can be used for development tasks in many languages through certain configurations or plug-ins, including python. You can search for "Python notepad ++" on the Internet to find many results. The method I used is as follows.ArticleProposed practice: open a pythonCodePress F5 to open the "run" dialog box, and enterCMD/K Python "$ (full_current_path)" & Echo. & pause & ExitClick "save", enter a name, such as "Run with Python", configure the following shortcut key, and click "OK. To run the python file, simply press the configured shortcut key or click "Run with Python" on the running menu.

I have been using this for a few days and it feels quite good. During file writing these two daysProgramIt can be run and no error is reported. However, in theory, a file should be generated but cannot be found. Instead, use the built-in Python idle to test the code. No problem is found. All the generated files are generated. Later I thought about the working directory problem and used the following code to print the current working directory:

 
Import osprint OS. getcwd ()

the installation directory of notepad ++ is displayed, which is determined to be a problem with the working directory. Because I have used notepad ++ before, I know about shortcut. XML is used to configure user shortcut keys. I opened it and found that several parameters should be resolved by notepad ++, such as $ (full_current_path), $ (npp_directory), $ (current_directory). During this time, I intentionally did not want to read the Windows Script. I had some simple understanding of the CMD command and tried to rewrite the running command: CMD/K cd "$ (current_directory) "& Python" $ (full_current_path) "& Echo. & pause & Exit . Use the above file again for testing. The working directory displayed this time is the directory where the file is located. Try the programs that write files.

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.