• 用sublime text3 建立python编译系统


    前面有了sublime text3以及python3 的安装教程,现在来用sublime text3 来构建一个python3的编译环境

    首先安装package control和sublimeREPL

    直接在install package下搜索sublimeREPL就可以了。

    然后配置编译系统,点击Tools->Build System->New Build System

    复制下面代码,并命名为Python3.sublime-build。

    {
        "cmd": ["C:/Python27/python.exe","-u","$file"],
        "file_regex": "^[ ]*File "(...*?)", line ([0-9]*)",
        "selector": "source.python",
        "encoding": "cp936",
    }

    其中cmd后面的是你安装的时候python.exe的地方,每个人都不一样,要改自己的路径。

    接着是设置快捷键,不然每次都要点击才能运行比较麻烦,

    所以首先点击preferences下的Key Bindings,输入如下内容:

        [
        { "keys": ["f5"], "caption": "SublimeREPL:Python", 
                          "command": "run_existing_window_command", "args":
                          {
                               "id": "repl_python_run",
                               "file": "config/Python/Main.sublime-menu"
                          } 
        },
     
        {"keys":["f1"],
        "caption": "SublimeREPL: Python",
        "command": "run_existing_window_command", "args":
        {"id": "repl_python","file": "config/Python/Main.sublime-menu"}
        }
        ]

    这时候按F1就能进入shell交互模式,F5就能编译你的程序。

    Anaconda代码自动补齐
    直接在package control 搜索安装即可,安装完成后,可适当根据自己习惯进行配置,Anaconda ->settings user配置如下:

    {
        //由于Anaconda插件本身无法知道Python安装的路径,所以需要设置Python主程序的实际位置
        "python_interpreter": "C:/Users/AppData/Local/Programs/Python/Python36-32/python.exe",
        //忽略各种空格不对, 超过79字, import的函数没有使用的提醒,
        "pep8_ignore": ["E501", "W292", "E303", "W391", "E225", "E302", "W293", "E402"],
        "pyflakes_explicit_ignore":
        [
            "UnusedImport"
        ],
        //保存文件后自动pep8格式化
        "auto_formatting": true,
        "auto_formatting_timeout": 5,
        //库函数的提示
        "enable_signatures_tooltip": true,
        "merge_signatures_and_doc":true,
    
        //ST3也有自动补全提示,但只提示文件中输入过的单词,这个功能可用提示变量可用的函数等。
        "suppress_word_completions": true,
        "suppress_explicit_completions": true,
        "complete_parameters": true,
        //代码排版时,行的默认长度太短,根据喜好设置
        "pep8_max_line_length": 120,
    
    }
  • 相关阅读:
    UltraSoft
    UltraSoft
    UltraSoft
    UltraSoft
    UltraSoft
    2020软工提问回顾与个人总结作业
    2020软工结对项目作业-简单几何形状间交点统计
    2020软工个人博客作业-博客园班级博客分析
    2020软工个人阅读博客作业
    2020软工第一次作业-热身
  • 原文地址:https://www.cnblogs.com/wushengyang/p/12253060.html
Copyright © 2020-2023  润新知