environment variable Configuration under window
By default, after you install Python under Windows, the system does not automatically add the appropriate environment variables. You cannot use the Python command directly at the command line at this time.
① first needs to register the Python environment variable in the system: assuming that the Python installation path is d:\IT\python27, modify the path in the system variable, high-level environment variable, my computer, properties, and so on:
;D: \it\python27;
(in order to run the Python command in command-line mode, you need to append the directory where the Python.exe resides to the environment variable of path.) )
Once the above environment variable is set up successfully, you can use the Python command directly at the command line. or execute "python *.py" to run the Python script.
② at this point, you can still run Python scripts only through Python *.py, and if you want to run *.py directly, simply modify the other environment variable Pathext:
Add in the environment variable pathext;. PY;. PYM
Once the above environment variable is set up successfully, you can run the Python script directly on the command line using "*.py".
③ How do I enable the Python interpreter to import directly from a third-party module other than the default installation path?
In order to import modules from a third party other than the default installation path (such as a module of your own), you need to create a new PYTHONPATH environment variable with the value of the directory where the module resides.
notepad++ running Python
① Open notepad++, run F5 or click to run;
② This step is the most critical, copy and paste the following statements into the input box:
cmd/k python "$ (full_current_path)" & PAUSE & EXIT   
Click Save
Explanation Run Command:
The meaning of cmd/k is to execute the following command, and to keep the window after execution is complete. (that is, cmd means to open the Command Prompt window and run the commands behind/k-python)
cmd/k python = = start –> run –> input cmd–> input python
$ (full_current_path) means the full path of the current file, which is the notepad++ macro definition
& is to connect more than one command
Pause indicates the end of the run and waits for an arbitrary key
Exit means close the command-line window (you can omit EXIT if you use cmd/c). )
Settings in the shortcut window:
Shortcut window just to set shortcut keys for running this command
Where name can be entered casually (for example: Run Python),
Shortcut keys can also be selected, the only rule is not to conflict with the set, otherwise it will not work, and this shortcut can be modified, so there is no need to worry (such as CTRL+F5).
When you are finished setting up, click OK to save this command.
Set the result:
③ Test:
Sublime Text 2 configuration python environment
① Click Preferences on the toolbar to open the Browse Packages. Locate Python in the Open folder and open the folder. Locate the file Python.sublime-build and open it.
② Modify the following content:
③ the contents of the path into the compiler's installation directory. Save the code and the Ctrl+b will run.
[Python] Python configuration