利用Pycharm来编写、执行python代码是一个不错的选择,Pycharm的安装的确也很方便。但是偶然看到别人用Sublime Text来编写、执行代码,觉得很酷。所以自己动手搭建环境。

1. 下载Sublime Text3--->win7系统,安装在C盘(wherever you like,你高兴就好。反正容量不大)C:\Program Files\Sublime Text 3(我的路径);

2. 打开cmd命令窗口,安装Flake8

  pip install flake8

3. 下载Package Control(点击Clone download下的Download ZIPx下载)--->在以下路径解压:C:\Users\Administrator\AppData\Roaming\Sublime Text 3(这个路径很容易找:打开软件--首选项(Preferences--Browse Packages)--打开目录后往后退一步就OK了)

  注意:不推荐通过Preferences下面的Packges Control来安装,后续会有各种问题

4. 安装插件:

通过快捷键:Ctrl+shift+p打开插一个输入框--->输入install--->按Enter键(窗口左下角就会出现Loading repositories)--->Loading结束后优惠弹出一个输入框(如下图10%***的那个)--->再这个输入框中输入插件名称,再按Enter键就开始安装插件了。

需要安装的插件是:SublimeLinter,SublimeLinter-flake8,Anaconda,SoDaReloaded,Zen Tabs,SublimeREPL等(安装插件后,重启生效)

5. 设置

5.1 Preferences--->Settings--->User

 {
"caret_style": "solid",
"color_scheme": "Packages/Tomorrow Color Schemes/Tomorrow-Night.tmTheme",
"draw_white_space": "all",
"file_exclude_patterns":
[
"*.pyc",
"*.pyo",
"*.exe",
"*.dll",
"*.obj",
"*.o",
"*.a",
"*.lib",
"*.so",
"*.dylib",
"*.ncb",
"*.sdf",
"*.suo",
"*.pdb",
"*.idb",
".DS_Store",
"*.class",
"*.psd",
"*.db",
"*.sublime-workspace"
],
"fold_buttons": false,
"folder_exclude_patterns":
[
".svn",
".git",
".hg",
"CVS",
"__pycache__"
],
"font_face": "Ubuntu Mono",
"font_options":
[
"directwrite",
"subpixel_antialias",
"no_bold",
"no_italic"
],
"font_size": 16,
"highlight_line": "true",
"highlight_modified_tabs": true,
"ignored_packages":
[
"Vintage"
],
"indent_guide_options":
[
"draw_active"
],
"line_padding_bottom": 1,
"line_padding_top": 2,
"scroll_past_end": true,
"shift_tab_unindent": true,
"theme": "SoDaReloaded Dark.sublime-theme",
"wide_caret": "true"
}

5.2 Preferences--->Package Settings--->Package Control--->Setting User

 {
"bootstrapped": true,
"in_process_packages":
[
],
"installed_packages":
[
"Anaconda",
"Package Control",
"SideBarEnhancements",
"SublimeLinter",
"SublimeLinter-flake8",
"SublimeREPL",
"Theme - SoDaReloaded",
"Tomorrow Color Schemes",
"View In Browser",
"Zen Tabs"
],
"repositories":
[
"https://github.com/n1k0/SublimeHighlight/tree/python3",
"https://github.com/n1k0/SublimeHighlight/tree/python3"
]
}

5.3 Prefereces-->Package Settings-->SublimeLinter-->Settings

改两处:把Default替换成user;添加python执行文件的路径在paths中。

5.4 Preferences--->Package Settings--->Zen Tab--->Setting User

 {
"open_tab_limit":5,
"highlight_modified_tabs":true,
"show_full_path":false
}

5.5 Preferences--->Settings - Syntax Specific

 "tab_size": 4,
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true,
"ensure_newline_at_eof_on_save": true,
"rulers": [
72,
79
],
"word_wrap": true,
"wrap_width": 80

6. 设置执行程序的快捷键

  可以通过点击Tools-->SublimeREPL-->Python-->Python-RUN current file来执行代码,但是过于麻烦,我们可以设置快捷键F5来执行程序。

设置方法:Preferences-->Key Bindings,添加如下代码。设置好后,运行效果如下图:

 [
{
"keys":["f5"],
"caption":"SublimeREPL:Pyhton - RUN current file",
"command":"run_existing_window_command",
"args":
{
"id":"repl_python_run",
"file":"config\\python\\Main.sublime-menu"
}
}
]

本文参考:让你用sublime写出最完美的python代码--windows环境

181102 Python环境搭建(安装Sublime Text3)的更多相关文章

  1. 4.7 Sublime Text3 中配置 Python环境 --之上安装Sublime 3

    返回总目录 目录: 1.展示效果: 2.缺优分析: 3.下载Sublime Text3 (一)展示效果: 1.能够交互式编写Python代码: 2.可以编写文件式Python代码: 3.能够自动补齐代 ...

  2. Python环境下的Sublime Text3无法使用input()函数

    在Sublime Text3中写好Python程序,按Ctrl+B运行程序,在控制台中输入内容,回车,程序没有响应.最后求助网络,找到了解决办法. 一.安装插件SublimeREPL 按Ctrl+Sh ...

  3. 在windows环境下基于sublime text3的node.js开发环境搭建

    首先安装sublime text3,百度一堆,自己找吧.理论上sublime text2应该也可以.我只能说一句:这个软件实在是太强悍了. 跨平台,丰富的插件体系,加上插件基本上就是一个强悍的ide了 ...

  4. Python 环境搭建(Win 安装以及Mac OS 安装)

    千里之行始于足下,今天我们先来学习 Python 环境搭建. 注意:本系列教程基于 Python 3.X Python 环境搭建 Win 安装 打开 Python 官网 https://www.pyt ...

  5. 下载安装sublime text3,打包sublime text3便携版,激活sublime text3,配置sublime text3的php环境

      下载安装sublime text3: http://www.sublimetext.com/3 安装就一直下一步   打包sublime text3便携版 : 参考http://segmentfa ...

  6. Python环境搭建和pycharm安装

    Python环境搭建和pycharm安装 本人安装环境为Windows10系统,下载的Python版本为3.4社区版本,可参考 1.下载Python3.4版本 官网:https://www.pytho ...

  7. python环境搭建以及pycharm的安装

    要实现python自动化,环境和IDE都是必须的.我选择的是python3.4.4版本以及pycharm社区版.      资源链接:https://pan.baidu.com/s/1hRqyRe3J ...

  8. python环境搭建、pycharm安装

    一.      实验目标 (1)  Python环境搭建 (2)  会pycharm安装和使用 (3)  了解python程序设计流程 二.      实验内容 1.勾选Add Python 3.7 ...

  9. python环境搭建以及jupyter notebook的安装和启动

    一.Python 环境搭建 本章节我们将向大家介绍如何在本地搭建Python开发环境. Python可应用于多平台包括 Linux 和 Mac OS X. 你可以通过终端窗口输入 "pyth ...

随机推荐

  1. java错误分类

    IllegalArgumentException 回直接crashError

  2. [转] GloVe公式推导

    from: https://pengfoo.com/post/machine-learning/2017-04-11 GloVe(Global Vectors for Word Representat ...

  3. PostgreSQL学习笔记(二)-安装pgAdmin

    继上篇安装PostgreSQL后,我们需要安装一个PostgreSQL的图形化管理工具. pgadmin管理工具 创建Python的虚拟环境 cd /root/venv python -m venv ...

  4. centos命令安装

    1.解决ifconfig命令失效:需要安装net-tools工具 yum install net-tools 2.免密码登录 (1)通过命令,产生公钥信息 ssh-keygen -t rsa 如果提示 ...

  5. IE兼容事件绑定V1.0

    想要兼容IE678,少用原型,因为它们没有完全实现ECMA-262规范 (function(window){ //兼容IE678时少用原型,因为它没有完全遵循ECMA-262规范 //衬垫代码:isA ...

  6. echarts-饼状图默认选中高亮

    1.首页需要设置legend legend: { data: ["积极", "负面"], selectedMode: false, show: false } ...

  7. 初学python之路-day09

    今天的主要内容为内存管理. 1.引用计数:垃圾回收机制的依据 # 1.变量的值被引用,该值的引用计数 +1 # 2.变量的值被解绑,该值的引用计数 -1 # 3.引用计数为0时就会被垃圾回收机制回收 ...

  8. 移动端添加横向滚动条&隐藏

    添加横向滚动条ul { display: flex; overflow-x: auto; overflow-y: hidden; white-space: nowrap; }隐藏滚动条,保留滚动效果 ...

  9. 机器学习实战1-K均值

    本例来源于github项目:https://github.com/jakevdp/sklearn_pycon2015/blob/master/notebooks/04.2-Clustering-KMe ...

  10. 单点登录前戏(未使用jwt版本)

    建表 from django.db import models import jwt # Create your models here. # 角色表 class RoleTable(models.M ...