sublime text3配置python開發環境(windows版)

來源:互聯網
上載者:User

標籤:設定   exist   pack   網址   nbsp   control   python開發   python3   cond   

安裝階段:
  1. sublime text3的安裝:
    • 下載網址:https://www.sublimetext.com/
    • 下載完成後 ,點擊安裝即可。
  2. 安裝Package Control:
    • 點擊 Tools -> install Package Control
  3. 安裝anaconda:
    • ctrl+shift+p -> 輸入install package -> 輸入anaconda -> 斷行符號
  4. 安裝SublimeREPL:
    • ctrl+shift+p -> 輸入install package -> 輸入 sublimeREPL -> 斷行符號
  5. 安裝Djaneiro:
    • ctrl+shift+p -> 輸入install package -> 輸入 Djaneiro -> 斷行符號
設定階段:
  • 配置SublimeREPL:
      Preferences -> Browse Packages -> SublimeREPL -> config -> python ->開啟 Main.sublime-menu -> 找到
{"command": "repl_open",                     "caption": "Python - RUN current file",                     "id": "repl_python_run",                     "mnemonic": "R",                     "args": {                        "type": "subprocess",                        "encoding": "utf8",                        "cmd": ["python", "-u", "-i", "$file_basename"],                        "cwd": "$file_path",                        "syntax": "Packages/Python/Python.tmLanguage",                        "external_id": "python",                        "extend_env": {"PYTHONIOENCODING": "utf-8"}                        }                    },

 修改其中的 "cmd" 項。

    • 如果電腦上裝有python2和python

        • 想要使用python2的cmd就填入 "cmd": ["python", "-u", "-i", "$file_basename"]
        • 想要是要python3的cmd就填入 "cmd": ["python3", "-u", "-i", "$file_basename"]
    • 如果電腦中只有一個python版本

        • 直接填入"cmd": ["python", "-u", "-i", "$file_basename"]
  • 自訂SublimeREPL快速鍵

    Preferences -> Browse Package -> SublimeREPL -> config -> python -> 開啟Default.sublime-commands -> 找到

{        "caption": "SublimeREPL: Python - RUN current file",        "command": "run_existing_window_command", "args":        {            "id": "repl_python_run",            "file": "config/Python/Main.sublime-menu"        }    },

 

並複製到 Preferences -> Key Bindings 中,並在代碼中添加想要設定的快速鍵,如下:

{        "keys": ["shift+f10"],     //修改方括弧中的內容,自訂快速鍵        "caption": "SublimeREPL: Python - RUN current file",        "command": "run_existing_window_command", "args":        {            "id": "repl_python_run",            "file": "config/Python/Main.sublime-menu"        }    },

 

sublime text3配置python開發環境(windows版)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.