SUBLIMETEXT3 Press Ctrl+b to execute Python no response

Source: Internet
Author: User

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

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.