Home  >  Article  >  Backend Development  >  How to use sublime text in python

How to use sublime text in python

PHP中文网
PHP中文网Original
2017-06-20 14:34:312069browse

1. Download the version suitable for your system from the official website of sublime text. Official website address:

2. After installation, open it in the menu bar: Preferences--->Settings (this is the latest version at the time of writing this)

3. After opening We will see two files like this, one Preferences.sublime-settings--Default and Preferences.sublime-settings--User

Then this User file is what we want to edit

4. Write this piece of configuration information/code in the curly brackets of the file, and then save it:

 1 // Settings in here override those in "Default/Preferences.sublime-settings", 2 // and are overridden in turn by syntax-specific settings. 3 { 4  5     "python":{ 6         "Python":"D:/Python27/python.exe", 7         "pythonExtraPaths": 8         [ 9             "D:/Python27",10             "D:/Python27/DLLS",11             "D:/Python27/Lib",12             "D:/Python27/Lib/site_packages"13         ]14     },15     16 }

5. After the configuration is completed, it should be executable by executing Ctrl-B. But it is found that there is no output information, then you need to configure the following section

File--->New File Create a new file and save it as Python.sublime-build (Python can also write other things you want For example, My_Python)

also needs to write a piece of configuration information/code inside, save:

1 {2     "shell_cmd": "d:/python27/python.exe -u \"$file\"",3     "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",4     "selector": "source.python",5     "encoding":"cp936"6 }

6. Execute Ctrl-B again, will it run normally? And see the output (provided you have output)

The above is the detailed content of How to use sublime text in python. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn