0. Install Windows version of the Python compilation environment installation package, can be downloaded on the python.org Web site, this installation path is C:\Python27\
1. Click Preferences on the toolbar to open the browsing package browse Packages. Locate Python in the Open folder, and open the folder. Locate the file Python.sublime-build and open it.
Modify the following:
{
"cmd": ["Python", "-U", "$file"],
"Path": "c:/python27/",
"File_regex": "^[]*file \" (... *?) \ ", line ([0-9]*)",
"Selector": "Source.python"
}
Modify the contents of the path to the compiler's installation directory. Save the code, CTRL+B can run
2. Install SUBLIMEREPL, configure Python interactive running environment
Sublimerepl,repl is the read-evaluation-print-loop, the process of interpreting language compilation runs. The SUBLIMEREPL plugin also supports direct compiler runs and interactions on the editor
2.1 Configure Python to run the current file directly
This is the direct interactive run of the current file name of the menu named: python_console_integrated.
windows open x:\xxx\SublimeText2\Packages\SublimeREPL\config\Python\Main.sublime-menu files, different environments may have different paths, find "id": "Repl_ Python's line, change the value of the args attribute under this JSON object to ["Python", "I", "-U", "$file _basename"], as shown in figure:
2.2 Keep the original interactive terminal function:
This is the menu name for running the Python Interactive terminal independently: Python_console_standalone,
Add one of the following configured nodes to the above file, and be aware that changing caption,id and cmd,id is not the same name as the file above
2.3 Click perferences-Keyboard bindings-user or default key bindings-users or defaults, set shortcut keys.
Where the ID value is the ID value in the JSON object in python_console_integrated, the keys can be selected by themselves, this time for F5
4. After the configuration is complete:
4.1 Run the program directly using CTRL+B without the need for interactive running.
4.2 Use F5 to run the current file when you need to interact with it directly.
4.3 If you just want to pull up a standalone Python interactive terminal without running the current file, call the standalone interactive terminal as follows: (Of course, you can also configure the shortcut keys for stand-alone terminals as described above, not configured this time)
5, add the third party package and module library path:
Open Python.sublime-build, join
"env": {"Pythonpath": "D:/python/lib"}
After that, you can put the third party modules all into the D:\python\lib directory.