Sublime sample code for python program development, sublimepython

Source: Internet
Author: User

Sublime sample code for python program development, sublimepython

This article introduces the sample code for Sublime to develop a python program. The details are as follows:

Download and install Python programs

Https://www.python.org/downloads/

Download and install sublime

Http://www.sublimetext.com/

Associate python

Preferences-> Browers Packages-> Python. sublime-build

Modify the Python. sublime-build File and add the python installation path.

{   "cmd": ["python", "-u", "$file"],   "path":"D:\Python33",   "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",   "selector": "source.python"}

Install Package Control

Sublime Package Control can be said to be a plug-in that must be installed, because it provides a convenient function to install, upgrade, and delete the Sublime plug-in.

Use the shortcut key ctrl + shift + p (Win, Linux) or cmd + shift + p (OS X), where commands starting with Package Control, the most common commands are Package Control: Install Package, Package Control: Remove Package, and Package Control: List Packages.

Installation Procedure: choose view> Show Console. Open the Console and paste the code of the corresponding version and press Enter.

Applicable to Sublime Text 3:

import urllib.request,os;pf='Package Control.sublime-package';ipp=sublime.installed_packages_path();urllib.request.install_opener(urllib.request.build_opener(urllib.request.ProxyHandler()));open(os.path.join(ipp,pf),'wb').write(urllib.request.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read())

Applicable to Sublime Text 2:

import urllib2,os;pf='Package Control.sublime-package';ipp=sublime.installed_packages_path();os.makedirs(ipp)ifnotos.path.exists(ipp)elseNone;urllib2.install_opener(urllib2.build_opener(urllib2.ProxyHandler()));open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read());print('Please restart Sublime Text to finish installation')

Install plug-in python code auto-completion plug-in (jedi)

Ctrl + shift + p open Package Control, enter Install Package and press enter, and enter jedi

The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.

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.