In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces the Sublime Text editor configuration Python interpreter method, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian with you to understand.
The Sublime Text editor configures Python interpreter methods:
1. First open Sublime, as shown in the following figure, and then select the "Preferences" tab.
2. Click the first option "Browse Packages …" And then the system will automatically navigate to the Sublime installation package directory
3. Then the folder interface of the following figure will pop up.
4. Find the Python folder in this pile of folders, as shown in the following figure, then enter the folder and find the file Python.sublime-build.
Open the file in Sublime, as shown in the following figure.
{"cmd": ["python.exe", "- u", "$file"], "path": "C:\ Python34", "file_regex": "^ [] File" (...?) ", line ([0-9] *)", "encoding": "gbk", "selector": "source.python"}
The content shown in the picture is my updated content, the original content is not so rich. There are two main changes, one is to add the path of the Python interpreter, the other is to add the coding part, the general choice of encoding is utf-8 or gbk, and some use cp936, mainly to prevent Sublime Text from reporting [Decode error-output not utf-8] errors. Generally speaking, if we do not set the coding, once we output a language other than English, there will be a coding problem, which is a headache. In general, it is not a big problem to try several kinds of coding.
6. After changing the Python.sublime-build file, press the shortcut key Ctrl+S to save it. Then open any Python file, and then click the tab Tools à Build System à Python in Sublime. As shown in the following figure, the whole process is equivalent to completing the perfect "connection" between Sublime and the Python interpreter.
7. Now you can use the shortcut key Ctrl+B or add the tab Tools à Build in turn, as shown in the following figure, and then you can run the current Python file, as shown in the following figure. The output part of the file is below the Sublime, which is usually a gray rectangle.
8. So far, the problem of configuring Python interpreter in Sublime and [Decode error-output not utf-8] error reporting has been successfully solved.
I hope that when the back friends encounter this problem again, they can take fewer detours. Although the editor currently uses Sublime Text 2, Sublime Text 3 is configured in the same way as Sublime Text 2, so I won't repeat it.
Thank you for reading this article carefully. I hope the article "how to configure the Python interpreter in the Sublime Text Editor" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support and follow the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.