Http://www.cnblogs.com/tt-0411/archive/2011/10/30/2229544.html
Notepad++ is a powerful editor with a set of configurations or plug-ins that can serve a variety of language development tasks, including Python. Search on the Internet "Python notepad++" can find a lot of results, I took the approach is this, this is the practice of most articles on the Internet: after opening a Python code file, press F5, open the "Run" dialog box, in the text box input cmd/k Python "$ (Full_current_path) "& ECHO. & PAUSE & EXIT, then click "Save", fill in a name, such as "Run with Python", configure the following shortcut keys, click OK. You can then run the Python file just by pressing the configured shortcut key or by clicking Run with Python on the running menu.
I used it for a couple of days and it felt good. And these two days in writing files, found that the program can run, no error, but theoretically should produce a file is still not found, instead of using Python idle to test the code, no problem, the resulting files are generated. After thinking about the working directory, use the following code to print the current working directory:
Import OS
Print OS.GETCWD ()
The
Displays the notepad++ installation directory and determines the problem with the working directory. Because previously used notepad++, know Shortcut.xml is configured user shortcut keys, opened to see, found that several parameters should be notepad++ itself, such as $ (Full_current_path), $ (npp_ DIRECTORY), $ (current_directory), and so on. This period of time intentionally or unintentionally looking at Windows script, the cmd command some simple understanding, on their own try to rewrite the running command: cmd/k CD "$ (current_directory)" & Python $ (full_ Current_path) "& ECHO. & PAUSE & EXIT . Again using the above file test, this time the working directory shown is the directory where the file. It's no problem to try the program that writes the document again.