Once the repository is enabled, install the Sublime Text 3 by typing: sudo apt install sublime-text; That’s it, you have installed Sublime Text 3 on your Ubuntu 20.04 desktop, and you can start using it. When a new version is released, you can update the Sublime package through your desktop standard Software Update tool. Starting Sublime Text #. Sublime Text is a commonly-used text editor used to write Python code. Sublime Text's slick user interface along with its numerous extensions for syntax highlighting, source file finding and analyzing code metrics make the editor more accessible to new programmers than. The most current version of Django at the time this tutorial was written was 3.0.4, and all testing was done with Python 3.7. None of the steps outlined in this tutorial should be incompatible with earlier versions of Django—I’ve used these techniques since Django 1.8. However, some changes are necessary if you’re using Python 2.
Sublime Text is a commonly-used text editorused to write Python code. Sublime Text's slick user interface along with itsnumerous extensions for syntax highlighting, source file finding and analyzingcode metrics make the editor more accessible to newprogrammers than some other applications like Vim andEmacs.
Sublime Text is an implementation of the text editors and IDEs concept. Learn how these parts fit together in the development environments chapter or view all topics.
What makes Sublime Text awesome?
Sublime Text is often the first editor that newer programmers pick up becauseit works on all operating systems and it is far more approachable thanEmacs, Vim or even PyCharm.
It is easy to get started in Sublime because the menus and options areaccessible by using a mouse. There are no different modes to learn likeVim's normal and insert modes. The keyboard shortcuts can be learned overtime rather than all at once in the case of Vim or Emacs.
Sublime Text works well for beginners as soon as they install it and thencan be extended with many of the features provided by an IDE likePyCharm as a developer's skill level ramps up.
An additional bonus of using Sublime Text as a Python developer is thatplugins are written in Python.Python developers can extend Sublime Text with their own programming languagerather than learn a new language like Emacs' Elisp or Vim's Vimscript.
Why use any other editor if Sublime is so great?
Picking a text editor or IDE to use tends tobe a weirdly personal decision for each developer. Yet it makes sense whenyou realize that you are going to spend hours upon hours every day in yourchosen environment so why not make sure it is one that is enjoyable andhighly productive?
For some folks they prefer Vim's keyboard-driven style,PyCharm's Swiss Army Knife set of Python tools or one ofthe many other editors with its own strengths and weaknesses.
The only 'best' editor choice is to pick one that works really well for youand stick to it. Master your tool so it gets out of your way and enablesas much time inprogramming flow aspossible.
Python-specific Sublime Text resources
There are many Python-specific Sublime Text tutorials and resources becausethe editor is so frequently used to create Python applications. The followinglinks should get your editor customized with linters,code metrics, syntax checking and many otherintegrated development environment features.
- Setting Up Sublime Text 3 for Full Stack Python Developmentis a spectacular tutorial that covers installing Sublime Text andconfiguring a multitude of helpful Python programming plugins.
- Sublime Text 3 Heavenis a quick overview of the extensions, packages and bonus toys thatone developer uses for his own Sublime Text development setup.
- Sublime Tutor is an interactive in-editorkeyboard shortcuts tutorial that plugs into Sublime so you can learn andbecome more productive as you use the editor.
- Using Generators for Fun and Profit - Utility for developersis not about setting up your Sublime Text environment but instead how tocreate your own plugins using Python. The tutorial is written by theauthor of a Sublime Text plugin who uses generatorsto implement features with Sublime's API.
- Turning Sublime Text Into a Lightweight Python IDEshows the basic settings and configuration specific to using Sublime withPython as more than just a text editor.
- Setting up Sublime Text 3 for Python Type Checkingshows one way of setting up support for Python 3.6 static type checking inSublime.
- Three steps to lint Python 3.6 in Sublime Textwalks through setting up Flake8 toenforce code style guidelines and show you the errors and warnings inSublime as you are working.
- Text editing techniques every front-end developer should knowgives examples in Sublime Text of time-saving text manipulation you maynot have known existed such as line bubbling, ragged line selection,AceJump and transpose. While the techniques can be used in most editorsthe provided video clips show how to perform each of these shortcuts inSublime. Apk edit foto video.
General Sublime Text resources
Sublime Text can be used for much more than Python development and there aremany useful tutorials that are not targeted at a specific programming languagewhich are still useful.
- Super charge your Sublime Text 3 to increase your productivityprovides many shortcuts and tricks for using the editor.
- Disassembling Sublime Text uses a binary disassembler to dive into the reverse engineeredsource code of Sublime Text because it is not open source software.
- Sync your sublime text 3 configurations safely and easyexplains how to mitigate configuration conflicts that can arise when tryingto use copied files from one computer to another.
- 7 shortcuts of a highly effective Sublime Text usershows keyboard shortcuts for opening any file, going to any specificblock of text, handling multiple cursors and more.
Sublime Plugin resources
Sublime Text plugins are written in Python which makes it convenient forour ecosystem to customize the editor. The following resources provideinformation on writing your own plugins as well as great community pluginsyou will want to take a look at adding to your installation.
- Sublime's documentation coversplugin basics, theAPI for plugins andgives a'Hello, world!'-level examplethat you can extend.
- Sublime Text plugin development basicshas some good advice and further resources.
- The 25 Best Sublime Text Plugins for Front End Developersis not specific to Python development but there is a bunch of overlapbetween plugins useful for general front-end development and any Pythonweb development project.
- 5 Awesome Sublime Plugins you Won’t Find in Top Plugin Postscovers some lesser-known plugins and how you can find your own viaPackage Control's trending plugins section.
What do you want to code using Sublime Text?
I want to learn how to code a Python web application using a framework.
I've built a Python web app, now how do I deploy it?
1、官方网站地址
2、Windows 10
3、Sublime Text 3 + 官网购买license(Just a suggestion,$80)
购买链接,Sublime Text may be downloaded and evaluated for free, however a license must be purchased for continued use。如果资金紧张,可以搜索破解版License(建议支持正版,本文不再提供破解版License)。
1、双击下载的.exe文件安装,安装路径不要有中文目录
2、安装Sublime Text 3时,勾选“Add to explorer context menu”,可以在文件右键菜单添加“Open with Sublime Text”,方便使用Sublime Text打开文件。
运行环境
1、打开Tools > Build System > New Build System.
2、点击New Build System后,会生成一个空配置文件,在这个配置文件内覆盖配置信息,本文python安装路径为“D:/Anaconda3”,(注意区分正反斜杠,请将路径换成python实际安装路径),然后按ctrl+s,将文件保存在默认路径,文件名命名为“Python3”
如图:
Sublime For Python 3
3、打开Tools > Build System,选择新建好的Python3即可
测试
1、新建test.py文件,输入简单python语句,按Ctrl+B运行
字体及字号
1、打开Preferences –>>Settings(Settings User),在右侧添加如下代码(font_face及font_size可根据个人喜好更改)
{
'color_scheme': 'Packages/Color Scheme - Default/Monokai.sublime-color-scheme',
'font_face': 'Consolas',
'font_size': 14,
'ignored_packages':
[
'Vintage'
],
'update_check': false,
// The number of spaces a tab is considered equal to
'tab_size': 4,
// Set to true to insert spaces when tab is pressed
'translate_tabs_to_spaces': true,
//设置保存时自动转换
'expand_tabs_on_save': true
}
'color_scheme': 'Packages/Color Scheme - Default/Monokai.sublime-color-scheme',
'font_face': 'Consolas',
'font_size': 14,
'ignored_packages':
[
'Vintage'
],
'update_check': false,
// The number of spaces a tab is considered equal to
'tab_size': 4,
// Set to true to insert spaces when tab is pressed
'translate_tabs_to_spaces': true,
//设置保存时自动转换
'expand_tabs_on_save': true
}
2、效果如下
四、安装Package Control(官网教程)
第一种方法:在线安装 Bluestacks mobile version.
通过快捷键[ctrl+`]或“View > Show Console”菜单打开控制台,将下面的Python代码粘贴到控制台里
注:上面代码仅适用于Sublime Text 3,如果是Sublime Text2请使用如下代码:
关掉并重新打开Sublime Text 3,如果在Perferences->package settings中能看到package control这一项,则表示安装成功。
第二种方法:手动安装
1、点击 Preferences > Browse Packages… 菜单
2、Browse up a folder and then into the Installed Packages/ folder
3、Download Package Control.sublime-package and copy it into the Installed Packages/ directory
4、Restart Sublime Text
2、Browse up a folder and then into the Installed Packages/ folder
3、Download Package Control.sublime-package and copy it into the Installed Packages/ directory
4、Restart Sublime Text
1、通过Package Control安装其他插件
1.按下Ctrl+Shift+P调出命令面板
Use Sublime Text With Python
2.输入install 调出 Install Package
3.在列表中选中要安装的插件,或者输入插件名,根据命令面板中的过滤结果,选择要安装的插件
2、通过Package Control查看已安装的插件
1. 按下Ctrl+Shift+P调出命令面板
2. 输入'package',在下拉列表找到'Package Control: list packages',选中后回车,可以显示全部插件列表。
SublimeCodeIntel
介绍
Full-featured code intelligence and smart autocomplete engine
- Jump to Symbol Definition - Jump to the file and line of the definition of a symbol.
- Imports autocomplete - Shows autocomplete with the available modules/symbols in real time.
- Function Call tooltips - Displays information in the status bar about the working function.
支持语言
JavaScript, ES6, Mason, XBL, XUL, RHTML, SCSS, Python, HTML, Ruby, Python, XML, XSLT, Django, HTML5, Perl, CSS, Twig, Less, Smarty, Node.js, Tcl, TemplateToolkit, PHP.
Installation
1.Control+Shift+P打开Package Control控制台
2.输入install,选择关联出来的install package
3.输入sublimecodeintel,然后点击列表提示的sublimecodeintel安装
4.安装完成之后,文本框会出现如下显示,或者可以通过【Preferences>Package Settings】中查看到已安装的sublimecodeintel插件
5.打开preferences->packages settings ->Package Control ->Settings-User,检查是否有如下红框代码,如果没有得手动添加
Suse studio imagewriter deb. 6.点击preferences中的browse Packages,进入SublimeCodeIntel文件夹,在当前的路径下新建.codeintel文件夹(windows中文件命名的时候为 .codeintel.),之后进入到 .codeintel文件夹中,新建文件“config.log”文件,打开输入(下文以路径“D:Anaconda3”为例,实际配置时请根据具体安装路径修改):
如图:
7.保存,重启Sublime Text 3
测试
新建文件并保存为.py文件,输入代码测试
![Sublime Sublime](https://i.ytimg.com/vi/qPTP6djelKY/maxresdefault.jpg)
SublimeREPL
介绍
添加快捷键后,可直接运行当前文件,非常方便
- Launch python in local or remote(1) virtualenv.
- Quickly run selected script or launch PDB.
- Use SublimeText Python console with history and multiline input.
使用方法
1、安装SublimeREPL插件后,打开Preferences->Key Bindings,添加快捷键:
测试
1、新建test.py文件,例如:
2、上文中SublimeREPL插件设置的快捷键是F5,所以按F5运行成功如下
SublimeTmpl
介绍
安装插件后,可以通过快捷键按照模板快速新建文件
使用方法
1、安装SublimeTmpl插件后,打开Preferences->Package Settings->SublimeTmpl->Settings User,添加以下内容
如图:
2、添加快捷键,打开Preferences->Key Bindings,添加红框中的快捷键代码
如图:
测试
打开Sublime Text 3,上文中SublimeTmpl插件设置的快捷键是'Ctrl+alt+n',按快捷键后成功新建文件如下
使用方法
1、安装ColorSublime插件完成后,打开Preferences->Color Scheme..,选择主题
Anaconda
Sublime Text 3 Python Ide
介绍
代码提示等许多功能,必备
安装方法
1、Preferences->Package Settings->Anaconda->Settings Default,修改'python_interpreter'为实际Python安装路径
Python In Sublime Text 3
2、Preferences->Package Settings->Anaconda->Settings User,添加如下内容
如图:
测试
1、打开Sublime Text3,新建任意*.py文件,输入语句测试,如图
posted @ 2017-03-22 14:18honkly 阅读(138503) 评论(7) 编辑收藏