Phenomenon:
When you open a. py file in sublime, you do not respond when you press "Ctrl+b". Click on the tools, compile the system already has and recognize Python, but do "run" ctrl+shift+b, no response, sublime the lower left corner prompts "no Build system with variant run".
Solve:
Open a CMD First, click in the upper-left corner, and select Properties. View the values in the current code page item in the properties----options. (This step is optional)
Then open the sublime installation directory, open the packages, find the "python.sublime-package" file inside, copy it and leave it as a backup. Change the suffix of this file to. zip and open the compressed package.
Find the "python.sublime-build" file in the open package and drag it out to edit it (the editing tool can be opened directly with sublime or another text editor).
The original file content should look like this:
{
"Shell_cmd": "Python-u" $file "",
"File_regex": "^[]*file" (... *) ", line ([0-9]*)",
"Selector": "Source.python",
"env": {"pythonioencoding": "Utf-8"},
"Variants":
[
{
"Name": "Syntax Check",
"Shell_cmd": "Python-m py_compile" ${file} "",
}
]
}
Change to this:
{
"cmd": ["Python", "-U", "$file"],
"File_regex": "^[]*file" (... *) ", line ([0-9]*)",
"Selector": "Source.python",
"Encoding": "Utf-8",
"env": {"pythonioencoding": "Utf-8"}
}
After saving it, drag it back to the zip overlay, and then change the. zip back to. Sublime-package, overwriting the packages directory as the modification is complete.
Open a. Py and hit the print ' Hello World ', Ctrl+b, to execute successfully.
PS: The cause of the unsuccessful may be the first line of the cmd command problem or the encoding encoding is incorrect (if the above method is unsuccessful, try to change the value of encoding to the first step to see the values) or other parameters have problems such as my here variants also have a problem, so I directly removed ....
SUBLIMETEXT3 Press Ctrl+b to execute Python no response